agora inbox for [email protected]
help / color / mirror / Atom feedRe: Foreign Join pushdowns not working properly for outer joins
978+ messages / 4 participants
[nested] [flat]
* Re: Foreign Join pushdowns not working properly for outer joins
@ 2017-04-12 06:48 David Rowley <[email protected]>
0 siblings, 1 reply; 978+ messages in thread
From: David Rowley @ 2017-04-12 06:48 UTC (permalink / raw)
To: Ashutosh Bapat <[email protected]>; +Cc: Etsuro Fujita <[email protected]>; pgsql-hackers
On 10 March 2017 at 17:33, Ashutosh Bapat
<[email protected]> wrote:
> Yes and I also forgot to update the function prologue to refer to the
> fpinfo_o/i instead of inner and outer relations. Attached patch
> corrects it.
Hi Ashutosh,
This seems to have conflicted with 28b04787. Do you want to rebase, or should I?
--
David Rowley http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 978+ messages in thread
* Re: Foreign Join pushdowns not working properly for outer joins
@ 2017-04-12 09:45 Ashutosh Bapat <[email protected]>
parent: David Rowley <[email protected]>
0 siblings, 1 reply; 978+ messages in thread
From: Ashutosh Bapat @ 2017-04-12 09:45 UTC (permalink / raw)
To: David Rowley <[email protected]>; +Cc: Etsuro Fujita <[email protected]>; pgsql-hackers
On Wed, Apr 12, 2017 at 12:18 PM, David Rowley
<[email protected]> wrote:
> On 10 March 2017 at 17:33, Ashutosh Bapat
> <[email protected]> wrote:
>> Yes and I also forgot to update the function prologue to refer to the
>> fpinfo_o/i instead of inner and outer relations. Attached patch
>> corrects it.
>
> Hi Ashutosh,
>
> This seems to have conflicted with 28b04787. Do you want to rebase, or should I?
Here you go.
--
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Attachments:
[application/octet-stream] 0001-Fix-reporting-of-violation-in-ExecConstraints-again.patch (12.0K, ../../CAFjFpRdWruLAJpeRRxSGzzmJXp7DSm9hyu_MMStXUaUC6MD-4Q@mail.gmail.com/2-0001-Fix-reporting-of-violation-in-ExecConstraints-again.patch)
download | inline diff:
From fb3e65de8018b867f755fe145fe4759be5a0fb54 Mon Sep 17 00:00:00 2001
From: amit <[email protected]>
Date: Fri, 31 Mar 2017 11:00:43 +0900
Subject: [PATCH] Fix reporting of violation in ExecConstraints, again
We decided in f1b4c771ea74f42447dccaed42ffcdcccf3aa694 that passing
the original slot (one containing the tuple formatted per root
partitioned table's tupdesc) to ExecConstraints(), but that breaks
certain cases. Imagine what would happen if a BR trigger changed the
tuple - the original slot would not contain those changes.
So, it seems better to convert (if necessary) the tuple formatted
per partition tupdesc after tuple-routing back to the root table's
format and use the converted tuple to make val_desc shown in the
message if an error occurs.
---
src/backend/commands/copy.c | 6 ++--
src/backend/executor/execMain.c | 53 +++++++++++++++++++++++++++++-----
src/backend/executor/execReplication.c | 4 +--
src/backend/executor/nodeModifyTable.c | 7 ++---
src/include/executor/executor.h | 3 +-
src/test/regress/expected/insert.out | 21 ++++++++++++--
src/test/regress/sql/insert.sql | 21 ++++++++++++--
7 files changed, 90 insertions(+), 25 deletions(-)
diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c
index 0158eda591..b537f84278 100644
--- a/src/backend/commands/copy.c
+++ b/src/backend/commands/copy.c
@@ -2505,8 +2505,7 @@ CopyFrom(CopyState cstate)
for (;;)
{
- TupleTableSlot *slot,
- *oldslot;
+ TupleTableSlot *slot;
bool skip_tuple;
Oid loaded_oid = InvalidOid;
@@ -2548,7 +2547,6 @@ CopyFrom(CopyState cstate)
ExecStoreTuple(tuple, slot, InvalidBuffer, false);
/* Determine the partition to heap_insert the tuple into */
- oldslot = slot;
if (cstate->partition_dispatch_info)
{
int leaf_part_index;
@@ -2650,7 +2648,7 @@ CopyFrom(CopyState cstate)
/* Check the constraints of the tuple */
if (cstate->rel->rd_att->constr ||
resultRelInfo->ri_PartitionCheck)
- ExecConstraints(resultRelInfo, slot, oldslot, estate);
+ ExecConstraints(resultRelInfo, slot, estate);
if (useHeapMultiInsert)
{
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c
index f2995f2e7b..0f92bd49db 100644
--- a/src/backend/executor/execMain.c
+++ b/src/backend/executor/execMain.c
@@ -1825,8 +1825,7 @@ ExecPartitionCheck(ResultRelInfo *resultRelInfo, TupleTableSlot *slot,
*/
void
ExecConstraints(ResultRelInfo *resultRelInfo,
- TupleTableSlot *slot, TupleTableSlot *orig_slot,
- EState *estate)
+ TupleTableSlot *slot, EState *estate)
{
Relation rel = resultRelInfo->ri_RelationDesc;
TupleDesc tupdesc = RelationGetDescr(rel);
@@ -1849,23 +1848,37 @@ ExecConstraints(ResultRelInfo *resultRelInfo,
{
char *val_desc;
Relation orig_rel = rel;
- TupleDesc orig_tupdesc = tupdesc;
+ TupleDesc orig_tupdesc = RelationGetDescr(rel);
/*
- * choose the correct relation to build val_desc from the
- * tuple contained in orig_slot
+ * If the tuple has been routed, it's been converted to the
+ * partition's rowtype, which might differ from the root
+ * table's. We must convert it back to the root table's
+ * rowtype so that val_desc shown error message matches the
+ * input tuple.
*/
if (resultRelInfo->ri_PartitionRoot)
{
+ HeapTuple tuple = ExecFetchSlotTuple(slot);
+ TupleConversionMap *map;
+
rel = resultRelInfo->ri_PartitionRoot;
tupdesc = RelationGetDescr(rel);
+ /* a reverse map */
+ map = convert_tuples_by_name(orig_tupdesc, tupdesc,
+ gettext_noop("could not convert row type"));
+ if (map != NULL)
+ {
+ tuple = do_convert_tuple(tuple, map);
+ ExecStoreTuple(tuple, slot, InvalidBuffer, false);
+ }
}
insertedCols = GetInsertedColumns(resultRelInfo, estate);
updatedCols = GetUpdatedColumns(resultRelInfo, estate);
modifiedCols = bms_union(insertedCols, updatedCols);
val_desc = ExecBuildSlotValueDescription(RelationGetRelid(rel),
- orig_slot,
+ slot,
tupdesc,
modifiedCols,
64);
@@ -1892,15 +1905,27 @@ ExecConstraints(ResultRelInfo *resultRelInfo,
/* See the comment above. */
if (resultRelInfo->ri_PartitionRoot)
{
+ HeapTuple tuple = ExecFetchSlotTuple(slot);
+ TupleDesc old_tupdesc = RelationGetDescr(rel);
+ TupleConversionMap *map;
+
rel = resultRelInfo->ri_PartitionRoot;
tupdesc = RelationGetDescr(rel);
+ /* a reverse map */
+ map = convert_tuples_by_name(old_tupdesc, tupdesc,
+ gettext_noop("could not convert row type"));
+ if (map != NULL)
+ {
+ tuple = do_convert_tuple(tuple, map);
+ ExecStoreTuple(tuple, slot, InvalidBuffer, false);
+ }
}
insertedCols = GetInsertedColumns(resultRelInfo, estate);
updatedCols = GetUpdatedColumns(resultRelInfo, estate);
modifiedCols = bms_union(insertedCols, updatedCols);
val_desc = ExecBuildSlotValueDescription(RelationGetRelid(rel),
- orig_slot,
+ slot,
tupdesc,
modifiedCols,
64);
@@ -1922,15 +1947,27 @@ ExecConstraints(ResultRelInfo *resultRelInfo,
/* See the comment above. */
if (resultRelInfo->ri_PartitionRoot)
{
+ HeapTuple tuple = ExecFetchSlotTuple(slot);
+ TupleDesc old_tupdesc = RelationGetDescr(rel);
+ TupleConversionMap *map;
+
rel = resultRelInfo->ri_PartitionRoot;
tupdesc = RelationGetDescr(rel);
+ /* a reverse map */
+ map = convert_tuples_by_name(old_tupdesc, tupdesc,
+ gettext_noop("could not convert row type"));
+ if (map != NULL)
+ {
+ tuple = do_convert_tuple(tuple, map);
+ ExecStoreTuple(tuple, slot, InvalidBuffer, false);
+ }
}
insertedCols = GetInsertedColumns(resultRelInfo, estate);
updatedCols = GetUpdatedColumns(resultRelInfo, estate);
modifiedCols = bms_union(insertedCols, updatedCols);
val_desc = ExecBuildSlotValueDescription(RelationGetRelid(rel),
- orig_slot,
+ slot,
tupdesc,
modifiedCols,
64);
diff --git a/src/backend/executor/execReplication.c b/src/backend/executor/execReplication.c
index f20d728ad5..327a0bad38 100644
--- a/src/backend/executor/execReplication.c
+++ b/src/backend/executor/execReplication.c
@@ -389,7 +389,7 @@ ExecSimpleRelationInsert(EState *estate, TupleTableSlot *slot)
/* Check the constraints of the tuple */
if (rel->rd_att->constr)
- ExecConstraints(resultRelInfo, slot, slot, estate);
+ ExecConstraints(resultRelInfo, slot, estate);
/* Store the slot into tuple that we can inspect. */
tuple = ExecMaterializeSlot(slot);
@@ -448,7 +448,7 @@ ExecSimpleRelationUpdate(EState *estate, EPQState *epqstate,
/* Check the constraints of the tuple */
if (rel->rd_att->constr)
- ExecConstraints(resultRelInfo, slot, slot, estate);
+ ExecConstraints(resultRelInfo, slot, estate);
/* Store the slot into tuple that we can write. */
tuple = ExecMaterializeSlot(slot);
diff --git a/src/backend/executor/nodeModifyTable.c b/src/backend/executor/nodeModifyTable.c
index 0b524e0b7c..00b736c22c 100644
--- a/src/backend/executor/nodeModifyTable.c
+++ b/src/backend/executor/nodeModifyTable.c
@@ -263,8 +263,7 @@ ExecInsert(ModifyTableState *mtstate,
Relation resultRelationDesc;
Oid newId;
List *recheckIndexes = NIL;
- TupleTableSlot *oldslot = slot,
- *result = NULL;
+ TupleTableSlot *result = NULL;
/*
* get the heap tuple out of the tuple table slot, making sure we have a
@@ -435,7 +434,7 @@ ExecInsert(ModifyTableState *mtstate,
* Check the constraints of the tuple
*/
if (resultRelationDesc->rd_att->constr || resultRelInfo->ri_PartitionCheck)
- ExecConstraints(resultRelInfo, slot, oldslot, estate);
+ ExecConstraints(resultRelInfo, slot, estate);
if (onconflict != ONCONFLICT_NONE && resultRelInfo->ri_NumIndices > 0)
{
@@ -993,7 +992,7 @@ lreplace:;
* tuple-routing is performed here, hence the slot remains unchanged.
*/
if (resultRelationDesc->rd_att->constr || resultRelInfo->ri_PartitionCheck)
- ExecConstraints(resultRelInfo, slot, slot, estate);
+ ExecConstraints(resultRelInfo, slot, estate);
/*
* replace the heap tuple
diff --git a/src/include/executor/executor.h b/src/include/executor/executor.h
index d3849b93eb..f7f3189a1a 100644
--- a/src/include/executor/executor.h
+++ b/src/include/executor/executor.h
@@ -186,8 +186,7 @@ extern void InitResultRelInfo(ResultRelInfo *resultRelInfo,
extern ResultRelInfo *ExecGetTriggerResultRel(EState *estate, Oid relid);
extern bool ExecContextForcesOids(PlanState *planstate, bool *hasoids);
extern void ExecConstraints(ResultRelInfo *resultRelInfo,
- TupleTableSlot *slot, TupleTableSlot *orig_slot,
- EState *estate);
+ TupleTableSlot *slot, EState *estate);
extern void ExecWithCheckOptions(WCOKind kind, ResultRelInfo *resultRelInfo,
TupleTableSlot *slot, EState *estate);
extern LockTupleMode ExecUpdateLockMode(EState *estate, ResultRelInfo *relinfo);
diff --git a/src/test/regress/expected/insert.out b/src/test/regress/expected/insert.out
index 7fafa98212..6f34b1c640 100644
--- a/src/test/regress/expected/insert.out
+++ b/src/test/regress/expected/insert.out
@@ -354,11 +354,26 @@ ERROR: no partition of relation "mlparted1" found for row
DETAIL: Partition key of the failing row contains ((b + 0)) = (5).
truncate mlparted;
alter table mlparted add constraint check_b check (b = 3);
--- check that correct input row is shown when constraint check_b fails on mlparted11
--- after "(1, 2)" is routed to it
+-- have a BR trigger modify the row such that the check_b is violated
+create function mlparted11_trig_fn()
+returns trigger AS
+$$
+begin
+ NEW.b := 4;
+ return NEW;
+end;
+$$
+language plpgsql;
+create trigger mlparted11_trig before insert ON mlparted11
+ for each row execute procedure mlparted11_trig_fn();
+-- check that the correct row is shown when constraint check_b fails after
+-- "(1, 2)" is routed to mlparted11 (actually "(1, 4)" would be shown due
+-- to the BR trigger mlparted11_trig_fn)
insert into mlparted values (1, 2);
ERROR: new row for relation "mlparted11" violates check constraint "check_b"
-DETAIL: Failing row contains (1, 2).
+DETAIL: Failing row contains (1, 4).
+drop trigger mlparted11_trig on mlparted11;
+drop function mlparted11_trig_fn();
-- check that inserting into an internal partition successfully results in
-- checking its partition constraint before inserting into the leaf partition
-- selected by tuple-routing
diff --git a/src/test/regress/sql/insert.sql b/src/test/regress/sql/insert.sql
index f9c00705a2..020854c960 100644
--- a/src/test/regress/sql/insert.sql
+++ b/src/test/regress/sql/insert.sql
@@ -217,9 +217,26 @@ insert into mlparted (a, b) values (1, 5);
truncate mlparted;
alter table mlparted add constraint check_b check (b = 3);
--- check that correct input row is shown when constraint check_b fails on mlparted11
--- after "(1, 2)" is routed to it
+
+-- have a BR trigger modify the row such that the check_b is violated
+create function mlparted11_trig_fn()
+returns trigger AS
+$$
+begin
+ NEW.b := 4;
+ return NEW;
+end;
+$$
+language plpgsql;
+create trigger mlparted11_trig before insert ON mlparted11
+ for each row execute procedure mlparted11_trig_fn();
+
+-- check that the correct row is shown when constraint check_b fails after
+-- "(1, 2)" is routed to mlparted11 (actually "(1, 4)" would be shown due
+-- to the BR trigger mlparted11_trig_fn)
insert into mlparted values (1, 2);
+drop trigger mlparted11_trig on mlparted11;
+drop function mlparted11_trig_fn();
-- check that inserting into an internal partition successfully results in
-- checking its partition constraint before inserting into the leaf partition
--
2.11.0
^ permalink raw reply [nested|flat] 978+ messages in thread
* Re: Foreign Join pushdowns not working properly for outer joins
@ 2017-04-12 12:57 David Rowley <[email protected]>
parent: Ashutosh Bapat <[email protected]>
0 siblings, 1 reply; 978+ messages in thread
From: David Rowley @ 2017-04-12 12:57 UTC (permalink / raw)
To: Ashutosh Bapat <[email protected]>; +Cc: Etsuro Fujita <[email protected]>; pgsql-hackers
On 12 April 2017 at 21:45, Ashutosh Bapat
<[email protected]> wrote:
> On Wed, Apr 12, 2017 at 12:18 PM, David Rowley
> <[email protected]> wrote:
>> On 10 March 2017 at 17:33, Ashutosh Bapat
>> <[email protected]> wrote:
>>> Yes and I also forgot to update the function prologue to refer to the
>>> fpinfo_o/i instead of inner and outer relations. Attached patch
>>> corrects it.
>>
>> Hi Ashutosh,
>>
>> This seems to have conflicted with 28b04787. Do you want to rebase, or should I?
>
> Here you go.
Looks like the wrong patch.
--
David Rowley http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 978+ messages in thread
* Re: Foreign Join pushdowns not working properly for outer joins
@ 2017-04-12 13:04 Ashutosh Bapat <[email protected]>
parent: David Rowley <[email protected]>
0 siblings, 1 reply; 978+ messages in thread
From: Ashutosh Bapat @ 2017-04-12 13:04 UTC (permalink / raw)
To: David Rowley <[email protected]>; +Cc: Etsuro Fujita <[email protected]>; pgsql-hackers
Sorry, here's the right one.
On Wed, Apr 12, 2017 at 6:27 PM, David Rowley
<[email protected]> wrote:
> On 12 April 2017 at 21:45, Ashutosh Bapat
> <[email protected]> wrote:
>> On Wed, Apr 12, 2017 at 12:18 PM, David Rowley
>> <[email protected]> wrote:
>>> On 10 March 2017 at 17:33, Ashutosh Bapat
>>> <[email protected]> wrote:
>>>> Yes and I also forgot to update the function prologue to refer to the
>>>> fpinfo_o/i instead of inner and outer relations. Attached patch
>>>> corrects it.
>>>
>>> Hi Ashutosh,
>>>
>>> This seems to have conflicted with 28b04787. Do you want to rebase, or should I?
>>
>> Here you go.
>
> Looks like the wrong patch.
>
>
> --
> David Rowley http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Training & Services
--
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Attachments:
[application/octet-stream] foreign_outerjoin_pushdown_fix_v5.patch (14.8K, ../../CAFjFpRcOCkO8W8JRu=DUkCg2Hg=XarkZ75WdHjh-47vyCzvuXA@mail.gmail.com/2-foreign_outerjoin_pushdown_fix_v5.patch)
download | inline diff:
From 88d5dd279f7da5df6056c3d341e58aa4a95ce24f Mon Sep 17 00:00:00 2001
From: Ashutosh Bapat <[email protected]>
Date: Wed, 12 Apr 2017 14:59:50 +0530
Subject: [PATCH] Set shippable extensions for a join relation being pushed
down.
Objects in an extension are shippable to a foreign server if the
extension is part of the server's shippable extensions list. So, the
list of extensions should be made available in fpinfo of the relation
being considered to be pushed down before any expressions are assessed
for being shippable. Fix foreign_join_ok() to do that for a join
relation.
The code to save FDW options in fpinfo is scattered at multiple
places. Bring all of that together into functions
apply_server_options(), apply_table_options() and merge_fdw_options().
David Rowley and Ashutosh Bapat, per gripe from David Rowley.
---
contrib/postgres_fdw/expected/postgres_fdw.out | 29 ++++
contrib/postgres_fdw/postgres_fdw.c | 194 +++++++++++++++---------
contrib/postgres_fdw/sql/postgres_fdw.sql | 8 +
3 files changed, 160 insertions(+), 71 deletions(-)
diff --git a/contrib/postgres_fdw/expected/postgres_fdw.out b/contrib/postgres_fdw/expected/postgres_fdw.out
index b29549a..c5c34af 100644
--- a/contrib/postgres_fdw/expected/postgres_fdw.out
+++ b/contrib/postgres_fdw/expected/postgres_fdw.out
@@ -1620,6 +1620,35 @@ SELECT t1.c1, t2.c1 FROM ft4 t1 FULL JOIN ft5 t2 ON (t1.c1 = t2.c1) WHERE (t1.c1
| 21
(10 rows)
+-- full outer join + WHERE clause with shippable extension set
+EXPLAIN (VERBOSE, COSTS OFF)
+SELECT t1.c1, t2.c2, t1.c3 FROM ft1 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE postgres_fdw_abs(t1.c1) > 0 OFFSET 10 LIMIT 10;
+ QUERY PLAN
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ Limit
+ Output: t1.c1, t2.c2, t1.c3
+ -> Foreign Scan
+ Output: t1.c1, t2.c2, t1.c3
+ Relations: (public.ft1 t1) FULL JOIN (public.ft2 t2)
+ Remote SQL: SELECT r1."C 1", r1.c3, r2.c2 FROM ("S 1"."T 1" r1 FULL JOIN "S 1"."T 1" r2 ON (((r1."C 1" = r2."C 1")))) WHERE ((public.postgres_fdw_abs(r1."C 1") > 0))
+(6 rows)
+
+ALTER SERVER loopback OPTIONS (DROP extensions);
+-- full outer join + WHERE clause with shippable extension not set
+EXPLAIN (VERBOSE, COSTS OFF)
+SELECT t1.c1, t2.c2, t1.c3 FROM ft1 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE postgres_fdw_abs(t1.c1) > 0 OFFSET 10 LIMIT 10;
+ QUERY PLAN
+-------------------------------------------------------------------------------------------------------------------------------
+ Limit
+ Output: t1.c1, t2.c2, t1.c3
+ -> Foreign Scan
+ Output: t1.c1, t2.c2, t1.c3
+ Filter: (postgres_fdw_abs(t1.c1) > 0)
+ Relations: (public.ft1 t1) FULL JOIN (public.ft2 t2)
+ Remote SQL: SELECT r1."C 1", r1.c3, r2.c2 FROM ("S 1"."T 1" r1 FULL JOIN "S 1"."T 1" r2 ON (((r1."C 1" = r2."C 1"))))
+(7 rows)
+
+ALTER SERVER loopback OPTIONS (ADD extensions 'postgres_fdw');
-- join two tables with FOR UPDATE clause
-- tests whole-row reference for row marks
EXPLAIN (VERBOSE, COSTS OFF)
diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c
index 8d02243..2ff3ad3 100644
--- a/contrib/postgres_fdw/postgres_fdw.c
+++ b/contrib/postgres_fdw/postgres_fdw.c
@@ -414,6 +414,11 @@ static void add_paths_with_pathkeys_for_rel(PlannerInfo *root, RelOptInfo *rel,
static void add_foreign_grouping_paths(PlannerInfo *root,
RelOptInfo *input_rel,
RelOptInfo *grouped_rel);
+static void apply_server_options(PgFdwRelationInfo *fpinfo);
+static void apply_table_options(PgFdwRelationInfo *fpinfo);
+static void merge_fdw_options(PgFdwRelationInfo *fpinfo,
+ PgFdwRelationInfo *fpinfo_o,
+ PgFdwRelationInfo *fpinfo_i);
/*
@@ -513,31 +518,9 @@ postgresGetForeignRelSize(PlannerInfo *root,
fpinfo->shippable_extensions = NIL;
fpinfo->fetch_size = 100;
- foreach(lc, fpinfo->server->options)
- {
- DefElem *def = (DefElem *) lfirst(lc);
+ apply_server_options(fpinfo);
- if (strcmp(def->defname, "use_remote_estimate") == 0)
- fpinfo->use_remote_estimate = defGetBoolean(def);
- else if (strcmp(def->defname, "fdw_startup_cost") == 0)
- fpinfo->fdw_startup_cost = strtod(defGetString(def), NULL);
- else if (strcmp(def->defname, "fdw_tuple_cost") == 0)
- fpinfo->fdw_tuple_cost = strtod(defGetString(def), NULL);
- else if (strcmp(def->defname, "extensions") == 0)
- fpinfo->shippable_extensions =
- ExtractExtensionList(defGetString(def), false);
- else if (strcmp(def->defname, "fetch_size") == 0)
- fpinfo->fetch_size = strtol(defGetString(def), NULL, 10);
- }
- foreach(lc, fpinfo->table->options)
- {
- DefElem *def = (DefElem *) lfirst(lc);
-
- if (strcmp(def->defname, "use_remote_estimate") == 0)
- fpinfo->use_remote_estimate = defGetBoolean(def);
- else if (strcmp(def->defname, "fetch_size") == 0)
- fpinfo->fetch_size = strtol(defGetString(def), NULL, 10);
- }
+ apply_table_options(fpinfo);
/*
* If the table or the server is configured to use remote estimates,
@@ -4115,6 +4098,15 @@ foreign_join_ok(PlannerInfo *root, RelOptInfo *joinrel, JoinType jointype,
return false;
/*
+ * This function should usually set FDW options in fpinfo after the join is
+ * deemed safe to push down to save some CPU cycles. But We need server
+ * specific options like extensions to decide push-down safety. For
+ * checking extension shippability, we need foreign server as well.
+ */
+ fpinfo->server = fpinfo_o->server;
+ merge_fdw_options(fpinfo, fpinfo_o, fpinfo_i);
+
+ /*
* Separate restrict list into join quals and pushed-down (other) quals.
*
* Join quals belonging to an outer join must all be shippable, else we
@@ -4279,15 +4271,6 @@ foreign_join_ok(PlannerInfo *root, RelOptInfo *joinrel, JoinType jointype,
/* Mark that this join can be pushed down safely */
fpinfo->pushdown_safe = true;
- /*
- * If user is willing to estimate cost for a scan of either of the joining
- * relations using EXPLAIN, he intends to estimate scans on that relation
- * more accurately. Then, it makes sense to estimate the cost of the join
- * with that relation more accurately using EXPLAIN.
- */
- fpinfo->use_remote_estimate = fpinfo_o->use_remote_estimate ||
- fpinfo_i->use_remote_estimate;
-
/* Get user mapping */
if (fpinfo->use_remote_estimate)
{
@@ -4299,17 +4282,6 @@ foreign_join_ok(PlannerInfo *root, RelOptInfo *joinrel, JoinType jointype,
else
fpinfo->user = NULL;
- /* Get foreign server */
- fpinfo->server = fpinfo_o->server;
-
- /*
- * Since both the joining relations come from the same server, the server
- * level options should have same value for both the relations. Pick from
- * any side.
- */
- fpinfo->fdw_startup_cost = fpinfo_o->fdw_startup_cost;
- fpinfo->fdw_tuple_cost = fpinfo_o->fdw_tuple_cost;
-
/*
* Set cached relation costs to some negative value, so that we can detect
* when they are set to some sensible costs, during one (usually the
@@ -4319,15 +4291,6 @@ foreign_join_ok(PlannerInfo *root, RelOptInfo *joinrel, JoinType jointype,
fpinfo->rel_total_cost = -1;
/*
- * Set fetch size to maximum of the joining sides, since we are expecting
- * the rows returned by the join to be proportional to the relation sizes.
- */
- if (fpinfo_o->fetch_size > fpinfo_i->fetch_size)
- fpinfo->fetch_size = fpinfo_o->fetch_size;
- else
- fpinfo->fetch_size = fpinfo_i->fetch_size;
-
- /*
* Set the string describing this join relation to be used in EXPLAIN
* output of corresponding ForeignScan.
*/
@@ -4385,6 +4348,110 @@ add_paths_with_pathkeys_for_rel(PlannerInfo *root, RelOptInfo *rel,
}
/*
+ * apply_server_options
+ * Parse options from foreign server any apply them to 'fpinfo'
+ *
+ * New options may also require tweaking merge_fdw_options()
+ */
+static void
+apply_server_options(PgFdwRelationInfo *fpinfo)
+{
+ ListCell *lc;
+
+ foreach(lc, fpinfo->server->options)
+ {
+ DefElem *def = (DefElem *) lfirst(lc);
+
+ if (strcmp(def->defname, "use_remote_estimate") == 0)
+ fpinfo->use_remote_estimate = defGetBoolean(def);
+ else if (strcmp(def->defname, "fdw_startup_cost") == 0)
+ fpinfo->fdw_startup_cost = strtod(defGetString(def), NULL);
+ else if (strcmp(def->defname, "fdw_tuple_cost") == 0)
+ fpinfo->fdw_tuple_cost = strtod(defGetString(def), NULL);
+ else if (strcmp(def->defname, "extensions") == 0)
+ fpinfo->shippable_extensions =
+ ExtractExtensionList(defGetString(def), false);
+ else if (strcmp(def->defname, "fetch_size") == 0)
+ fpinfo->fetch_size = strtol(defGetString(def), NULL, 10);
+ }
+}
+
+/*
+ * apply_table_options
+ * Parse options from foreign table any apply them to 'fpinfo'
+ *
+ * New options may also require tweaking merge_fdw_options()
+ */
+static void
+apply_table_options(PgFdwRelationInfo *fpinfo)
+{
+ ListCell *lc;
+
+ foreach(lc, fpinfo->table->options)
+ {
+ DefElem *def = (DefElem *) lfirst(lc);
+
+ if (strcmp(def->defname, "use_remote_estimate") == 0)
+ fpinfo->use_remote_estimate = defGetBoolean(def);
+ else if (strcmp(def->defname, "fetch_size") == 0)
+ fpinfo->fetch_size = strtol(defGetString(def), NULL, 10);
+ }
+}
+
+/*
+ * merge_fdw_options
+ * Merge FDW options from input relations into a new set of options for a
+ * join or an upper rel.
+
+ * For a join relation FDW specific information about both the inner and outer
+ * relations is provided using fpinfo_i and fpinfo_o resp. For an upper
+ * relation fpinfo_o provides the same for the input relation; fpinfo_i is
+ * expected to NULL. With a join rel, the foreign server on either side of the
+ * join is expected to match, this means we can derive server options from
+ * either side, although we choose outer. Some table level options may require
+ * merging.
+ */
+static void
+merge_fdw_options(PgFdwRelationInfo *fpinfo, PgFdwRelationInfo *fpinfo_o,
+ PgFdwRelationInfo *fpinfo_i)
+{
+ /* We must always have fpinfo_o. */
+ Assert(fpinfo_o);
+
+ /* fpinfo_i may be NULL, but if present the servers must both match */
+ Assert(!fpinfo_i ||
+ fpinfo_i->server->serverid == fpinfo_o->server->serverid);
+
+ /* Copy the server specific FDW options from the outer relation. */
+ fpinfo->fdw_startup_cost = fpinfo_o->fdw_startup_cost;
+ fpinfo->fdw_tuple_cost = fpinfo_o->fdw_tuple_cost;
+ fpinfo->shippable_extensions = fpinfo_o->shippable_extensions;
+ fpinfo->use_remote_estimate = fpinfo_o->use_remote_estimate;
+ fpinfo->fetch_size = fpinfo_o->fetch_size;
+
+ /* Merge the table level options from either side of the join. */
+ if (fpinfo_i)
+ {
+ /*
+ * We'll prefer to use remote estimates for this join if any table
+ * from either side of the join is using remote estimates. This is
+ * most likely going to be preferred since they're already willing to
+ * pay the price of a round trip to get the remote EXPLAIN. In any
+ * case it's not entirely clear how best else we might handle this.
+ */
+ fpinfo->use_remote_estimate = fpinfo_o->use_remote_estimate ||
+ fpinfo_i->use_remote_estimate;
+
+ /*
+ * Set fetch size to maximum of the joining sides, since we are
+ * expecting the rows returned by the join to be proportional to the
+ * relation sizes.
+ */
+ fpinfo->fetch_size = Max(fpinfo_o->fetch_size, fpinfo_i->fetch_size);
+ }
+}
+
+/*
* postgresGetForeignJoinPaths
* Add possible ForeignPath to joinrel, if join is safe to push down.
*/
@@ -4715,18 +4782,6 @@ foreign_grouping_ok(PlannerInfo *root, RelOptInfo *grouped_rel)
fpinfo->pushdown_safe = true;
/*
- * If user is willing to estimate cost for a scan using EXPLAIN, he
- * intends to estimate scans on that relation more accurately. Then, it
- * makes sense to estimate the cost of the grouping on that relation more
- * accurately using EXPLAIN.
- */
- fpinfo->use_remote_estimate = ofpinfo->use_remote_estimate;
-
- /* Copy startup and tuple cost as is from underneath input rel's fpinfo */
- fpinfo->fdw_startup_cost = ofpinfo->fdw_startup_cost;
- fpinfo->fdw_tuple_cost = ofpinfo->fdw_tuple_cost;
-
- /*
* Set cached relation costs to some negative value, so that we can detect
* when they are set to some sensible costs, during one (usually the
* first) of the calls to estimate_path_cost_size().
@@ -4734,9 +4789,6 @@ foreign_grouping_ok(PlannerInfo *root, RelOptInfo *grouped_rel)
fpinfo->rel_startup_cost = -1;
fpinfo->rel_total_cost = -1;
- /* Set fetch size same as that of underneath input rel's fpinfo */
- fpinfo->fetch_size = ofpinfo->fetch_size;
-
/*
* Set the string describing this grouped relation to be used in EXPLAIN
* output of corresponding ForeignScan.
@@ -4812,13 +4864,13 @@ add_foreign_grouping_paths(PlannerInfo *root, RelOptInfo *input_rel,
fpinfo->outerrel = input_rel;
/*
- * Copy foreign table, foreign server, user mapping, shippable extensions
- * etc. details from the input relation's fpinfo.
+ * Copy foreign table, foreign server, user mapping, FDW options etc.
+ * details from the input relation's fpinfo.
*/
fpinfo->table = ifpinfo->table;
fpinfo->server = ifpinfo->server;
fpinfo->user = ifpinfo->user;
- fpinfo->shippable_extensions = ifpinfo->shippable_extensions;
+ merge_fdw_options(fpinfo, ifpinfo , NULL);
/* Assess if it is safe to push down aggregation and grouping. */
if (!foreign_grouping_ok(root, grouped_rel))
diff --git a/contrib/postgres_fdw/sql/postgres_fdw.sql b/contrib/postgres_fdw/sql/postgres_fdw.sql
index 423eb02..9b8c21e 100644
--- a/contrib/postgres_fdw/sql/postgres_fdw.sql
+++ b/contrib/postgres_fdw/sql/postgres_fdw.sql
@@ -447,6 +447,14 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGHT
EXPLAIN (VERBOSE, COSTS OFF)
SELECT t1.c1, t2.c1 FROM ft4 t1 FULL JOIN ft5 t2 ON (t1.c1 = t2.c1) WHERE (t1.c1 = t2.c1 OR t1.c1 IS NULL) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10;
SELECT t1.c1, t2.c1 FROM ft4 t1 FULL JOIN ft5 t2 ON (t1.c1 = t2.c1) WHERE (t1.c1 = t2.c1 OR t1.c1 IS NULL) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10;
+-- full outer join + WHERE clause with shippable extension set
+EXPLAIN (VERBOSE, COSTS OFF)
+SELECT t1.c1, t2.c2, t1.c3 FROM ft1 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE postgres_fdw_abs(t1.c1) > 0 OFFSET 10 LIMIT 10;
+ALTER SERVER loopback OPTIONS (DROP extensions);
+-- full outer join + WHERE clause with shippable extension not set
+EXPLAIN (VERBOSE, COSTS OFF)
+SELECT t1.c1, t2.c2, t1.c3 FROM ft1 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE postgres_fdw_abs(t1.c1) > 0 OFFSET 10 LIMIT 10;
+ALTER SERVER loopback OPTIONS (ADD extensions 'postgres_fdw');
-- join two tables with FOR UPDATE clause
-- tests whole-row reference for row marks
EXPLAIN (VERBOSE, COSTS OFF)
--
1.7.9.5
^ permalink raw reply [nested|flat] 978+ messages in thread
* Re: Foreign Join pushdowns not working properly for outer joins
@ 2017-04-12 23:22 Peter Eisentraut <[email protected]>
parent: Ashutosh Bapat <[email protected]>
0 siblings, 1 reply; 978+ messages in thread
From: Peter Eisentraut @ 2017-04-12 23:22 UTC (permalink / raw)
To: Ashutosh Bapat <[email protected]>; David Rowley <[email protected]>; +Cc: Etsuro Fujita <[email protected]>; pgsql-hackers
Is this patch considered ready for review as a backpatch candidate?
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 978+ messages in thread
* Re: Foreign Join pushdowns not working properly for outer joins
@ 2017-04-13 02:05 David Rowley <[email protected]>
parent: Peter Eisentraut <[email protected]>
0 siblings, 1 reply; 978+ messages in thread
From: David Rowley @ 2017-04-13 02:05 UTC (permalink / raw)
To: Peter Eisentraut <[email protected]>; +Cc: Ashutosh Bapat <[email protected]>; Etsuro Fujita <[email protected]>; pgsql-hackers
On 13 April 2017 at 11:22, Peter Eisentraut
<[email protected]> wrote:
> Is this patch considered ready for review as a backpatch candidate?
Yes, however, the v5 patch is based on master. The v4 patch should
apply to 9.6. Diffing the two patches I see another tiny change to a
comment, of which I think needs re-worded anyway.
+ * This function should usually set FDW options in fpinfo after the join is
+ * deemed safe to push down to save some CPU cycles. But We need server
+ * specific options like extensions to decide push-down safety. For
+ * checking extension shippability, we need foreign server as well.
+ */
This might be better written as:
Ordinarily, we might be tempted into delaying the merging of the FDW
options until we've deemed the foreign join to be ok. However, we must
do this before performing this test so that we know which quals can be
evaluated on the foreign server. This may depend on the
shippable_extensions.
Apart from that, it all looks fine to me.
--
David Rowley http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 978+ messages in thread
* Re: Foreign Join pushdowns not working properly for outer joins
@ 2017-04-14 04:24 Ashutosh Bapat <[email protected]>
parent: David Rowley <[email protected]>
0 siblings, 1 reply; 978+ messages in thread
From: Ashutosh Bapat @ 2017-04-14 04:24 UTC (permalink / raw)
To: David Rowley <[email protected]>; +Cc: Peter Eisentraut <[email protected]>; Etsuro Fujita <[email protected]>; pgsql-hackers
On Thu, Apr 13, 2017 at 7:35 AM, David Rowley
<[email protected]> wrote:
> On 13 April 2017 at 11:22, Peter Eisentraut
> <[email protected]> wrote:
>> Is this patch considered ready for review as a backpatch candidate?
>
> Yes, however, the v5 patch is based on master. The v4 patch should
> apply to 9.6. Diffing the two patches I see another tiny change to a
> comment, of which I think needs re-worded anyway.
>
> + * This function should usually set FDW options in fpinfo after the join is
> + * deemed safe to push down to save some CPU cycles. But We need server
> + * specific options like extensions to decide push-down safety. For
> + * checking extension shippability, we need foreign server as well.
> + */
>
> This might be better written as:
>
> Ordinarily, we might be tempted into delaying the merging of the FDW
> options until we've deemed the foreign join to be ok. However, we must
> do this before performing this test so that we know which quals can be
> evaluated on the foreign server. This may depend on the
> shippable_extensions.
>
This looks better. Here are patches for master and 9.6.
Since join pushdown was supported in 9.6 the patch should be
backported to 9.6 as well. Attached is the patch (_96) for 9.6,
created by rebasing on 9.6 branch and removing conflict. _v6 is
applicable on master.
--
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Attachments:
[application/octet-stream] foreign_outerjoin_pushdown_fix_96.patch (12.9K, ../../CAFjFpRd1fbtHWMg25xV4PHPfzrJt34y6Qe2YQMa_4BU6mYdWEg@mail.gmail.com/2-foreign_outerjoin_pushdown_fix_96.patch)
download | inline diff:
From 7ed4810b9d31f5c10780818ca801db6864dffc2f Mon Sep 17 00:00:00 2001
From: Ashutosh Bapat <[email protected]>
Date: Wed, 12 Apr 2017 14:59:50 +0530
Subject: [PATCH] Set shippable extensions for a join relation being pushed
down.
Objects in an extension are shippable to a foreign server if the
extension is part of the server's shippable extensions list. So, the
list of extensions should be made available in fpinfo of the relation
being considered to be pushed down before any expressions are assessed
for being shippable. Fix foreign_join_ok() to do that for a join
relation.
The code to save FDW options in fpinfo is scattered at multiple
places. Bring all of that together into functions
apply_server_options(), apply_table_options() and merge_fdw_options().
David Rowley and Ashutosh Bapat, per gripe from David Rowley.
---
contrib/postgres_fdw/expected/postgres_fdw.out | 29 ++++
contrib/postgres_fdw/postgres_fdw.c | 174 ++++++++++++++++--------
contrib/postgres_fdw/sql/postgres_fdw.sql | 8 ++
3 files changed, 158 insertions(+), 53 deletions(-)
diff --git a/contrib/postgres_fdw/expected/postgres_fdw.out b/contrib/postgres_fdw/expected/postgres_fdw.out
index 9a1c68f..f19cb77 100644
--- a/contrib/postgres_fdw/expected/postgres_fdw.out
+++ b/contrib/postgres_fdw/expected/postgres_fdw.out
@@ -1501,6 +1501,35 @@ SELECT t1.c1, t2.c1 FROM ft4 t1 FULL JOIN ft5 t2 ON (t1.c1 = t2.c1) WHERE (t1.c1
| 21
(10 rows)
+-- full outer join + WHERE clause with shippable extension set
+EXPLAIN (VERBOSE, COSTS OFF)
+SELECT t1.c1, t2.c2, t1.c3 FROM ft1 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE postgres_fdw_abs(t1.c1) > 0 OFFSET 10 LIMIT 10;
+ QUERY PLAN
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ Limit
+ Output: t1.c1, t2.c2, t1.c3
+ -> Foreign Scan
+ Output: t1.c1, t2.c2, t1.c3
+ Relations: (public.ft1 t1) FULL JOIN (public.ft2 t2)
+ Remote SQL: SELECT r1."C 1", r1.c3, r2.c2 FROM ("S 1"."T 1" r1 FULL JOIN "S 1"."T 1" r2 ON (((r1."C 1" = r2."C 1")))) WHERE ((public.postgres_fdw_abs(r1."C 1") > 0))
+(6 rows)
+
+ALTER SERVER loopback OPTIONS (DROP extensions);
+-- full outer join + WHERE clause with shippable extension not set
+EXPLAIN (VERBOSE, COSTS OFF)
+SELECT t1.c1, t2.c2, t1.c3 FROM ft1 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE postgres_fdw_abs(t1.c1) > 0 OFFSET 10 LIMIT 10;
+ QUERY PLAN
+-------------------------------------------------------------------------------------------------------------------------------
+ Limit
+ Output: t1.c1, t2.c2, t1.c3
+ -> Foreign Scan
+ Output: t1.c1, t2.c2, t1.c3
+ Filter: (postgres_fdw_abs(t1.c1) > 0)
+ Relations: (public.ft1 t1) FULL JOIN (public.ft2 t2)
+ Remote SQL: SELECT r1."C 1", r1.c3, r2.c2 FROM ("S 1"."T 1" r1 FULL JOIN "S 1"."T 1" r2 ON (((r1."C 1" = r2."C 1"))))
+(7 rows)
+
+ALTER SERVER loopback OPTIONS (ADD extensions 'postgres_fdw');
-- join two tables with FOR UPDATE clause
-- tests whole-row reference for row marks
EXPLAIN (VERBOSE, COSTS OFF)
diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c
index 856798e..c7d3324 100644
--- a/contrib/postgres_fdw/postgres_fdw.c
+++ b/contrib/postgres_fdw/postgres_fdw.c
@@ -405,6 +405,11 @@ static List *get_useful_pathkeys_for_relation(PlannerInfo *root,
static List *get_useful_ecs_for_relation(PlannerInfo *root, RelOptInfo *rel);
static void add_paths_with_pathkeys_for_rel(PlannerInfo *root, RelOptInfo *rel,
Path *epq_path);
+static void apply_server_options(PgFdwRelationInfo *fpinfo);
+static void apply_table_options(PgFdwRelationInfo *fpinfo);
+static void merge_fdw_options(PgFdwRelationInfo *fpinfo,
+ PgFdwRelationInfo *fpinfo_o,
+ PgFdwRelationInfo *fpinfo_i);
/*
@@ -501,31 +506,9 @@ postgresGetForeignRelSize(PlannerInfo *root,
fpinfo->shippable_extensions = NIL;
fpinfo->fetch_size = 100;
- foreach(lc, fpinfo->server->options)
- {
- DefElem *def = (DefElem *) lfirst(lc);
-
- if (strcmp(def->defname, "use_remote_estimate") == 0)
- fpinfo->use_remote_estimate = defGetBoolean(def);
- else if (strcmp(def->defname, "fdw_startup_cost") == 0)
- fpinfo->fdw_startup_cost = strtod(defGetString(def), NULL);
- else if (strcmp(def->defname, "fdw_tuple_cost") == 0)
- fpinfo->fdw_tuple_cost = strtod(defGetString(def), NULL);
- else if (strcmp(def->defname, "extensions") == 0)
- fpinfo->shippable_extensions =
- ExtractExtensionList(defGetString(def), false);
- else if (strcmp(def->defname, "fetch_size") == 0)
- fpinfo->fetch_size = strtol(defGetString(def), NULL, 10);
- }
- foreach(lc, fpinfo->table->options)
- {
- DefElem *def = (DefElem *) lfirst(lc);
+ apply_server_options(fpinfo);
- if (strcmp(def->defname, "use_remote_estimate") == 0)
- fpinfo->use_remote_estimate = defGetBoolean(def);
- else if (strcmp(def->defname, "fetch_size") == 0)
- fpinfo->fetch_size = strtol(defGetString(def), NULL, 10);
- }
+ apply_table_options(fpinfo);
/*
* If the table or the server is configured to use remote estimates,
@@ -3990,6 +3973,16 @@ foreign_join_ok(PlannerInfo *root, RelOptInfo *joinrel, JoinType jointype,
joinclauses = NIL;
}
+ /*
+ * Ordinarily, we might be tempted into delaying the merging of the FDW
+ * options until we've deemed the foreign join to be ok. However, we must
+ * do this before performing this test so that we know which quals can be
+ * evaluated on the foreign server. This may depend on the
+ * shippable_extensions.
+ */
+ fpinfo->server = fpinfo_o->server;
+ merge_fdw_options(fpinfo, fpinfo_o, fpinfo_i);
+
/* Join quals must be safe to push down. */
foreach(lc, joinclauses)
{
@@ -4113,15 +4106,6 @@ foreign_join_ok(PlannerInfo *root, RelOptInfo *joinrel, JoinType jointype,
/* Mark that this join can be pushed down safely */
fpinfo->pushdown_safe = true;
- /*
- * If user is willing to estimate cost for a scan of either of the joining
- * relations using EXPLAIN, he intends to estimate scans on that relation
- * more accurately. Then, it makes sense to estimate the cost the join
- * with that relation more accurately using EXPLAIN.
- */
- fpinfo->use_remote_estimate = fpinfo_o->use_remote_estimate ||
- fpinfo_i->use_remote_estimate;
-
/* Get user mapping */
if (fpinfo->use_remote_estimate)
{
@@ -4133,17 +4117,6 @@ foreign_join_ok(PlannerInfo *root, RelOptInfo *joinrel, JoinType jointype,
else
fpinfo->user = NULL;
- /* Get foreign server */
- fpinfo->server = fpinfo_o->server;
-
- /*
- * Since both the joining relations come from the same server, the server
- * level options should have same value for both the relations. Pick from
- * any side.
- */
- fpinfo->fdw_startup_cost = fpinfo_o->fdw_startup_cost;
- fpinfo->fdw_tuple_cost = fpinfo_o->fdw_tuple_cost;
-
/*
* Set cached relation costs to some negative value, so that we can detect
* when they are set to some sensible costs, during one (usually the
@@ -4153,15 +4126,6 @@ foreign_join_ok(PlannerInfo *root, RelOptInfo *joinrel, JoinType jointype,
fpinfo->rel_total_cost = -1;
/*
- * Set fetch size to maximum of the joining sides, since we are expecting
- * the rows returned by the join to be proportional to the relation sizes.
- */
- if (fpinfo_o->fetch_size > fpinfo_i->fetch_size)
- fpinfo->fetch_size = fpinfo_o->fetch_size;
- else
- fpinfo->fetch_size = fpinfo_i->fetch_size;
-
- /*
* Set the string describing this join relation to be used in EXPLAIN
* output of corresponding ForeignScan.
*/
@@ -4209,6 +4173,110 @@ add_paths_with_pathkeys_for_rel(PlannerInfo *root, RelOptInfo *rel,
}
/*
+ * apply_server_options
+ * Parse options from foreign server any apply them to 'fpinfo'
+ *
+ * New options may also require tweaking merge_fdw_options()
+ */
+static void
+apply_server_options(PgFdwRelationInfo *fpinfo)
+{
+ ListCell *lc;
+
+ foreach(lc, fpinfo->server->options)
+ {
+ DefElem *def = (DefElem *) lfirst(lc);
+
+ if (strcmp(def->defname, "use_remote_estimate") == 0)
+ fpinfo->use_remote_estimate = defGetBoolean(def);
+ else if (strcmp(def->defname, "fdw_startup_cost") == 0)
+ fpinfo->fdw_startup_cost = strtod(defGetString(def), NULL);
+ else if (strcmp(def->defname, "fdw_tuple_cost") == 0)
+ fpinfo->fdw_tuple_cost = strtod(defGetString(def), NULL);
+ else if (strcmp(def->defname, "extensions") == 0)
+ fpinfo->shippable_extensions =
+ ExtractExtensionList(defGetString(def), false);
+ else if (strcmp(def->defname, "fetch_size") == 0)
+ fpinfo->fetch_size = strtol(defGetString(def), NULL, 10);
+ }
+}
+
+/*
+ * apply_table_options
+ * Parse options from foreign table any apply them to 'fpinfo'
+ *
+ * New options may also require tweaking merge_fdw_options()
+ */
+static void
+apply_table_options(PgFdwRelationInfo *fpinfo)
+{
+ ListCell *lc;
+
+ foreach(lc, fpinfo->table->options)
+ {
+ DefElem *def = (DefElem *) lfirst(lc);
+
+ if (strcmp(def->defname, "use_remote_estimate") == 0)
+ fpinfo->use_remote_estimate = defGetBoolean(def);
+ else if (strcmp(def->defname, "fetch_size") == 0)
+ fpinfo->fetch_size = strtol(defGetString(def), NULL, 10);
+ }
+}
+
+/*
+ * merge_fdw_options
+ * Merge FDW options from input relations into a new set of options for a
+ * join or an upper rel.
+
+ * For a join relation FDW specific information about both the inner and outer
+ * relations is provided using fpinfo_i and fpinfo_o resp. For an upper
+ * relation fpinfo_o provides the same for the input relation; fpinfo_i is
+ * expected to NULL. With a join rel, the foreign server on either side of the
+ * join is expected to match, this means we can derive server options from
+ * either side, although we choose outer. Some table level options may require
+ * merging.
+ */
+static void
+merge_fdw_options(PgFdwRelationInfo *fpinfo, PgFdwRelationInfo *fpinfo_o,
+ PgFdwRelationInfo *fpinfo_i)
+{
+ /* We must always have fpinfo_o. */
+ Assert(fpinfo_o);
+
+ /* fpinfo_i may be NULL, but if present the servers must both match */
+ Assert(!fpinfo_i ||
+ fpinfo_i->server->serverid == fpinfo_o->server->serverid);
+
+ /* Copy the server specific FDW options from the outer relation. */
+ fpinfo->fdw_startup_cost = fpinfo_o->fdw_startup_cost;
+ fpinfo->fdw_tuple_cost = fpinfo_o->fdw_tuple_cost;
+ fpinfo->shippable_extensions = fpinfo_o->shippable_extensions;
+ fpinfo->use_remote_estimate = fpinfo_o->use_remote_estimate;
+ fpinfo->fetch_size = fpinfo_o->fetch_size;
+
+ /* Merge the table level options from either side of the join. */
+ if (fpinfo_i)
+ {
+ /*
+ * We'll prefer to use remote estimates for this join if any table
+ * from either side of the join is using remote estimates. This is
+ * most likely going to be preferred since they're already willing to
+ * pay the price of a round trip to get the remote EXPLAIN. In any
+ * case it's not entirely clear how best else we might handle this.
+ */
+ fpinfo->use_remote_estimate = fpinfo_o->use_remote_estimate ||
+ fpinfo_i->use_remote_estimate;
+
+ /*
+ * Set fetch size to maximum of the joining sides, since we are
+ * expecting the rows returned by the join to be proportional to the
+ * relation sizes.
+ */
+ fpinfo->fetch_size = Max(fpinfo_o->fetch_size, fpinfo_i->fetch_size);
+ }
+}
+
+/*
* postgresGetForeignJoinPaths
* Add possible ForeignPath to joinrel, if join is safe to push down.
*/
diff --git a/contrib/postgres_fdw/sql/postgres_fdw.sql b/contrib/postgres_fdw/sql/postgres_fdw.sql
index b09244a..654a579 100644
--- a/contrib/postgres_fdw/sql/postgres_fdw.sql
+++ b/contrib/postgres_fdw/sql/postgres_fdw.sql
@@ -422,6 +422,14 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGHT
EXPLAIN (VERBOSE, COSTS OFF)
SELECT t1.c1, t2.c1 FROM ft4 t1 FULL JOIN ft5 t2 ON (t1.c1 = t2.c1) WHERE (t1.c1 = t2.c1 OR t1.c1 IS NULL) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10;
SELECT t1.c1, t2.c1 FROM ft4 t1 FULL JOIN ft5 t2 ON (t1.c1 = t2.c1) WHERE (t1.c1 = t2.c1 OR t1.c1 IS NULL) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10;
+-- full outer join + WHERE clause with shippable extension set
+EXPLAIN (VERBOSE, COSTS OFF)
+SELECT t1.c1, t2.c2, t1.c3 FROM ft1 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE postgres_fdw_abs(t1.c1) > 0 OFFSET 10 LIMIT 10;
+ALTER SERVER loopback OPTIONS (DROP extensions);
+-- full outer join + WHERE clause with shippable extension not set
+EXPLAIN (VERBOSE, COSTS OFF)
+SELECT t1.c1, t2.c2, t1.c3 FROM ft1 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE postgres_fdw_abs(t1.c1) > 0 OFFSET 10 LIMIT 10;
+ALTER SERVER loopback OPTIONS (ADD extensions 'postgres_fdw');
-- join two tables with FOR UPDATE clause
-- tests whole-row reference for row marks
EXPLAIN (VERBOSE, COSTS OFF)
--
1.7.9.5
[application/octet-stream] foreign_outerjoin_pushdown_fix_v6.patch (14.8K, ../../CAFjFpRd1fbtHWMg25xV4PHPfzrJt34y6Qe2YQMa_4BU6mYdWEg@mail.gmail.com/3-foreign_outerjoin_pushdown_fix_v6.patch)
download | inline diff:
From e33fed472fcb4ce65220830b2e159e0219c97506 Mon Sep 17 00:00:00 2001
From: Ashutosh Bapat <[email protected]>
Date: Wed, 12 Apr 2017 14:59:50 +0530
Subject: [PATCH] Set shippable extensions for a join relation being pushed
down.
Objects in an extension are shippable to a foreign server if the
extension is part of the server's shippable extensions list. So, the
list of extensions should be made available in fpinfo of the relation
being considered to be pushed down before any expressions are assessed
for being shippable. Fix foreign_join_ok() to do that for a join
relation.
The code to save FDW options in fpinfo is scattered at multiple
places. Bring all of that together into functions
apply_server_options(), apply_table_options() and merge_fdw_options().
David Rowley and Ashutosh Bapat, per gripe from David Rowley.
---
contrib/postgres_fdw/expected/postgres_fdw.out | 29 ++++
contrib/postgres_fdw/postgres_fdw.c | 195 +++++++++++++++---------
contrib/postgres_fdw/sql/postgres_fdw.sql | 8 +
3 files changed, 161 insertions(+), 71 deletions(-)
diff --git a/contrib/postgres_fdw/expected/postgres_fdw.out b/contrib/postgres_fdw/expected/postgres_fdw.out
index b29549a..c5c34af 100644
--- a/contrib/postgres_fdw/expected/postgres_fdw.out
+++ b/contrib/postgres_fdw/expected/postgres_fdw.out
@@ -1620,6 +1620,35 @@ SELECT t1.c1, t2.c1 FROM ft4 t1 FULL JOIN ft5 t2 ON (t1.c1 = t2.c1) WHERE (t1.c1
| 21
(10 rows)
+-- full outer join + WHERE clause with shippable extension set
+EXPLAIN (VERBOSE, COSTS OFF)
+SELECT t1.c1, t2.c2, t1.c3 FROM ft1 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE postgres_fdw_abs(t1.c1) > 0 OFFSET 10 LIMIT 10;
+ QUERY PLAN
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ Limit
+ Output: t1.c1, t2.c2, t1.c3
+ -> Foreign Scan
+ Output: t1.c1, t2.c2, t1.c3
+ Relations: (public.ft1 t1) FULL JOIN (public.ft2 t2)
+ Remote SQL: SELECT r1."C 1", r1.c3, r2.c2 FROM ("S 1"."T 1" r1 FULL JOIN "S 1"."T 1" r2 ON (((r1."C 1" = r2."C 1")))) WHERE ((public.postgres_fdw_abs(r1."C 1") > 0))
+(6 rows)
+
+ALTER SERVER loopback OPTIONS (DROP extensions);
+-- full outer join + WHERE clause with shippable extension not set
+EXPLAIN (VERBOSE, COSTS OFF)
+SELECT t1.c1, t2.c2, t1.c3 FROM ft1 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE postgres_fdw_abs(t1.c1) > 0 OFFSET 10 LIMIT 10;
+ QUERY PLAN
+-------------------------------------------------------------------------------------------------------------------------------
+ Limit
+ Output: t1.c1, t2.c2, t1.c3
+ -> Foreign Scan
+ Output: t1.c1, t2.c2, t1.c3
+ Filter: (postgres_fdw_abs(t1.c1) > 0)
+ Relations: (public.ft1 t1) FULL JOIN (public.ft2 t2)
+ Remote SQL: SELECT r1."C 1", r1.c3, r2.c2 FROM ("S 1"."T 1" r1 FULL JOIN "S 1"."T 1" r2 ON (((r1."C 1" = r2."C 1"))))
+(7 rows)
+
+ALTER SERVER loopback OPTIONS (ADD extensions 'postgres_fdw');
-- join two tables with FOR UPDATE clause
-- tests whole-row reference for row marks
EXPLAIN (VERBOSE, COSTS OFF)
diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c
index 8d02243..7bcec7c 100644
--- a/contrib/postgres_fdw/postgres_fdw.c
+++ b/contrib/postgres_fdw/postgres_fdw.c
@@ -414,6 +414,11 @@ static void add_paths_with_pathkeys_for_rel(PlannerInfo *root, RelOptInfo *rel,
static void add_foreign_grouping_paths(PlannerInfo *root,
RelOptInfo *input_rel,
RelOptInfo *grouped_rel);
+static void apply_server_options(PgFdwRelationInfo *fpinfo);
+static void apply_table_options(PgFdwRelationInfo *fpinfo);
+static void merge_fdw_options(PgFdwRelationInfo *fpinfo,
+ PgFdwRelationInfo *fpinfo_o,
+ PgFdwRelationInfo *fpinfo_i);
/*
@@ -513,31 +518,9 @@ postgresGetForeignRelSize(PlannerInfo *root,
fpinfo->shippable_extensions = NIL;
fpinfo->fetch_size = 100;
- foreach(lc, fpinfo->server->options)
- {
- DefElem *def = (DefElem *) lfirst(lc);
+ apply_server_options(fpinfo);
- if (strcmp(def->defname, "use_remote_estimate") == 0)
- fpinfo->use_remote_estimate = defGetBoolean(def);
- else if (strcmp(def->defname, "fdw_startup_cost") == 0)
- fpinfo->fdw_startup_cost = strtod(defGetString(def), NULL);
- else if (strcmp(def->defname, "fdw_tuple_cost") == 0)
- fpinfo->fdw_tuple_cost = strtod(defGetString(def), NULL);
- else if (strcmp(def->defname, "extensions") == 0)
- fpinfo->shippable_extensions =
- ExtractExtensionList(defGetString(def), false);
- else if (strcmp(def->defname, "fetch_size") == 0)
- fpinfo->fetch_size = strtol(defGetString(def), NULL, 10);
- }
- foreach(lc, fpinfo->table->options)
- {
- DefElem *def = (DefElem *) lfirst(lc);
-
- if (strcmp(def->defname, "use_remote_estimate") == 0)
- fpinfo->use_remote_estimate = defGetBoolean(def);
- else if (strcmp(def->defname, "fetch_size") == 0)
- fpinfo->fetch_size = strtol(defGetString(def), NULL, 10);
- }
+ apply_table_options(fpinfo);
/*
* If the table or the server is configured to use remote estimates,
@@ -4115,6 +4098,16 @@ foreign_join_ok(PlannerInfo *root, RelOptInfo *joinrel, JoinType jointype,
return false;
/*
+ * Ordinarily, we might be tempted into delaying the merging of the FDW
+ * options until we've deemed the foreign join to be ok. However, we must
+ * do this before performing this test so that we know which quals can be
+ * evaluated on the foreign server. This may depend on the
+ * shippable_extensions.
+ */
+ fpinfo->server = fpinfo_o->server;
+ merge_fdw_options(fpinfo, fpinfo_o, fpinfo_i);
+
+ /*
* Separate restrict list into join quals and pushed-down (other) quals.
*
* Join quals belonging to an outer join must all be shippable, else we
@@ -4279,15 +4272,6 @@ foreign_join_ok(PlannerInfo *root, RelOptInfo *joinrel, JoinType jointype,
/* Mark that this join can be pushed down safely */
fpinfo->pushdown_safe = true;
- /*
- * If user is willing to estimate cost for a scan of either of the joining
- * relations using EXPLAIN, he intends to estimate scans on that relation
- * more accurately. Then, it makes sense to estimate the cost of the join
- * with that relation more accurately using EXPLAIN.
- */
- fpinfo->use_remote_estimate = fpinfo_o->use_remote_estimate ||
- fpinfo_i->use_remote_estimate;
-
/* Get user mapping */
if (fpinfo->use_remote_estimate)
{
@@ -4299,17 +4283,6 @@ foreign_join_ok(PlannerInfo *root, RelOptInfo *joinrel, JoinType jointype,
else
fpinfo->user = NULL;
- /* Get foreign server */
- fpinfo->server = fpinfo_o->server;
-
- /*
- * Since both the joining relations come from the same server, the server
- * level options should have same value for both the relations. Pick from
- * any side.
- */
- fpinfo->fdw_startup_cost = fpinfo_o->fdw_startup_cost;
- fpinfo->fdw_tuple_cost = fpinfo_o->fdw_tuple_cost;
-
/*
* Set cached relation costs to some negative value, so that we can detect
* when they are set to some sensible costs, during one (usually the
@@ -4319,15 +4292,6 @@ foreign_join_ok(PlannerInfo *root, RelOptInfo *joinrel, JoinType jointype,
fpinfo->rel_total_cost = -1;
/*
- * Set fetch size to maximum of the joining sides, since we are expecting
- * the rows returned by the join to be proportional to the relation sizes.
- */
- if (fpinfo_o->fetch_size > fpinfo_i->fetch_size)
- fpinfo->fetch_size = fpinfo_o->fetch_size;
- else
- fpinfo->fetch_size = fpinfo_i->fetch_size;
-
- /*
* Set the string describing this join relation to be used in EXPLAIN
* output of corresponding ForeignScan.
*/
@@ -4385,6 +4349,110 @@ add_paths_with_pathkeys_for_rel(PlannerInfo *root, RelOptInfo *rel,
}
/*
+ * apply_server_options
+ * Parse options from foreign server any apply them to 'fpinfo'
+ *
+ * New options may also require tweaking merge_fdw_options()
+ */
+static void
+apply_server_options(PgFdwRelationInfo *fpinfo)
+{
+ ListCell *lc;
+
+ foreach(lc, fpinfo->server->options)
+ {
+ DefElem *def = (DefElem *) lfirst(lc);
+
+ if (strcmp(def->defname, "use_remote_estimate") == 0)
+ fpinfo->use_remote_estimate = defGetBoolean(def);
+ else if (strcmp(def->defname, "fdw_startup_cost") == 0)
+ fpinfo->fdw_startup_cost = strtod(defGetString(def), NULL);
+ else if (strcmp(def->defname, "fdw_tuple_cost") == 0)
+ fpinfo->fdw_tuple_cost = strtod(defGetString(def), NULL);
+ else if (strcmp(def->defname, "extensions") == 0)
+ fpinfo->shippable_extensions =
+ ExtractExtensionList(defGetString(def), false);
+ else if (strcmp(def->defname, "fetch_size") == 0)
+ fpinfo->fetch_size = strtol(defGetString(def), NULL, 10);
+ }
+}
+
+/*
+ * apply_table_options
+ * Parse options from foreign table any apply them to 'fpinfo'
+ *
+ * New options may also require tweaking merge_fdw_options()
+ */
+static void
+apply_table_options(PgFdwRelationInfo *fpinfo)
+{
+ ListCell *lc;
+
+ foreach(lc, fpinfo->table->options)
+ {
+ DefElem *def = (DefElem *) lfirst(lc);
+
+ if (strcmp(def->defname, "use_remote_estimate") == 0)
+ fpinfo->use_remote_estimate = defGetBoolean(def);
+ else if (strcmp(def->defname, "fetch_size") == 0)
+ fpinfo->fetch_size = strtol(defGetString(def), NULL, 10);
+ }
+}
+
+/*
+ * merge_fdw_options
+ * Merge FDW options from input relations into a new set of options for a
+ * join or an upper rel.
+
+ * For a join relation FDW specific information about both the inner and outer
+ * relations is provided using fpinfo_i and fpinfo_o resp. For an upper
+ * relation fpinfo_o provides the same for the input relation; fpinfo_i is
+ * expected to NULL. With a join rel, the foreign server on either side of the
+ * join is expected to match, this means we can derive server options from
+ * either side, although we choose outer. Some table level options may require
+ * merging.
+ */
+static void
+merge_fdw_options(PgFdwRelationInfo *fpinfo, PgFdwRelationInfo *fpinfo_o,
+ PgFdwRelationInfo *fpinfo_i)
+{
+ /* We must always have fpinfo_o. */
+ Assert(fpinfo_o);
+
+ /* fpinfo_i may be NULL, but if present the servers must both match */
+ Assert(!fpinfo_i ||
+ fpinfo_i->server->serverid == fpinfo_o->server->serverid);
+
+ /* Copy the server specific FDW options from the outer relation. */
+ fpinfo->fdw_startup_cost = fpinfo_o->fdw_startup_cost;
+ fpinfo->fdw_tuple_cost = fpinfo_o->fdw_tuple_cost;
+ fpinfo->shippable_extensions = fpinfo_o->shippable_extensions;
+ fpinfo->use_remote_estimate = fpinfo_o->use_remote_estimate;
+ fpinfo->fetch_size = fpinfo_o->fetch_size;
+
+ /* Merge the table level options from either side of the join. */
+ if (fpinfo_i)
+ {
+ /*
+ * We'll prefer to use remote estimates for this join if any table
+ * from either side of the join is using remote estimates. This is
+ * most likely going to be preferred since they're already willing to
+ * pay the price of a round trip to get the remote EXPLAIN. In any
+ * case it's not entirely clear how best else we might handle this.
+ */
+ fpinfo->use_remote_estimate = fpinfo_o->use_remote_estimate ||
+ fpinfo_i->use_remote_estimate;
+
+ /*
+ * Set fetch size to maximum of the joining sides, since we are
+ * expecting the rows returned by the join to be proportional to the
+ * relation sizes.
+ */
+ fpinfo->fetch_size = Max(fpinfo_o->fetch_size, fpinfo_i->fetch_size);
+ }
+}
+
+/*
* postgresGetForeignJoinPaths
* Add possible ForeignPath to joinrel, if join is safe to push down.
*/
@@ -4715,18 +4783,6 @@ foreign_grouping_ok(PlannerInfo *root, RelOptInfo *grouped_rel)
fpinfo->pushdown_safe = true;
/*
- * If user is willing to estimate cost for a scan using EXPLAIN, he
- * intends to estimate scans on that relation more accurately. Then, it
- * makes sense to estimate the cost of the grouping on that relation more
- * accurately using EXPLAIN.
- */
- fpinfo->use_remote_estimate = ofpinfo->use_remote_estimate;
-
- /* Copy startup and tuple cost as is from underneath input rel's fpinfo */
- fpinfo->fdw_startup_cost = ofpinfo->fdw_startup_cost;
- fpinfo->fdw_tuple_cost = ofpinfo->fdw_tuple_cost;
-
- /*
* Set cached relation costs to some negative value, so that we can detect
* when they are set to some sensible costs, during one (usually the
* first) of the calls to estimate_path_cost_size().
@@ -4734,9 +4790,6 @@ foreign_grouping_ok(PlannerInfo *root, RelOptInfo *grouped_rel)
fpinfo->rel_startup_cost = -1;
fpinfo->rel_total_cost = -1;
- /* Set fetch size same as that of underneath input rel's fpinfo */
- fpinfo->fetch_size = ofpinfo->fetch_size;
-
/*
* Set the string describing this grouped relation to be used in EXPLAIN
* output of corresponding ForeignScan.
@@ -4812,13 +4865,13 @@ add_foreign_grouping_paths(PlannerInfo *root, RelOptInfo *input_rel,
fpinfo->outerrel = input_rel;
/*
- * Copy foreign table, foreign server, user mapping, shippable extensions
- * etc. details from the input relation's fpinfo.
+ * Copy foreign table, foreign server, user mapping, FDW options etc.
+ * details from the input relation's fpinfo.
*/
fpinfo->table = ifpinfo->table;
fpinfo->server = ifpinfo->server;
fpinfo->user = ifpinfo->user;
- fpinfo->shippable_extensions = ifpinfo->shippable_extensions;
+ merge_fdw_options(fpinfo, ifpinfo , NULL);
/* Assess if it is safe to push down aggregation and grouping. */
if (!foreign_grouping_ok(root, grouped_rel))
diff --git a/contrib/postgres_fdw/sql/postgres_fdw.sql b/contrib/postgres_fdw/sql/postgres_fdw.sql
index 423eb02..9b8c21e 100644
--- a/contrib/postgres_fdw/sql/postgres_fdw.sql
+++ b/contrib/postgres_fdw/sql/postgres_fdw.sql
@@ -447,6 +447,14 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGHT
EXPLAIN (VERBOSE, COSTS OFF)
SELECT t1.c1, t2.c1 FROM ft4 t1 FULL JOIN ft5 t2 ON (t1.c1 = t2.c1) WHERE (t1.c1 = t2.c1 OR t1.c1 IS NULL) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10;
SELECT t1.c1, t2.c1 FROM ft4 t1 FULL JOIN ft5 t2 ON (t1.c1 = t2.c1) WHERE (t1.c1 = t2.c1 OR t1.c1 IS NULL) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10;
+-- full outer join + WHERE clause with shippable extension set
+EXPLAIN (VERBOSE, COSTS OFF)
+SELECT t1.c1, t2.c2, t1.c3 FROM ft1 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE postgres_fdw_abs(t1.c1) > 0 OFFSET 10 LIMIT 10;
+ALTER SERVER loopback OPTIONS (DROP extensions);
+-- full outer join + WHERE clause with shippable extension not set
+EXPLAIN (VERBOSE, COSTS OFF)
+SELECT t1.c1, t2.c2, t1.c3 FROM ft1 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE postgres_fdw_abs(t1.c1) > 0 OFFSET 10 LIMIT 10;
+ALTER SERVER loopback OPTIONS (ADD extensions 'postgres_fdw');
-- join two tables with FOR UPDATE clause
-- tests whole-row reference for row marks
EXPLAIN (VERBOSE, COSTS OFF)
--
1.7.9.5
^ permalink raw reply [nested|flat] 978+ messages in thread
* Re: Foreign Join pushdowns not working properly for outer joins
@ 2017-04-25 02:50 Peter Eisentraut <[email protected]>
parent: Ashutosh Bapat <[email protected]>
0 siblings, 2 replies; 978+ messages in thread
From: Peter Eisentraut @ 2017-04-25 02:50 UTC (permalink / raw)
To: Ashutosh Bapat <[email protected]>; David Rowley <[email protected]>; +Cc: Etsuro Fujita <[email protected]>; pgsql-hackers
On 4/14/17 00:24, Ashutosh Bapat wrote:
> This looks better. Here are patches for master and 9.6.
> Since join pushdown was supported in 9.6 the patch should be
> backported to 9.6 as well. Attached is the patch (_96) for 9.6,
> created by rebasing on 9.6 branch and removing conflict. _v6 is
> applicable on master.
Committed to PG10. I'll work on backpatching next.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 978+ messages in thread
* Re: Foreign Join pushdowns not working properly for outer joins
@ 2017-04-25 05:21 Ashutosh Bapat <[email protected]>
parent: Peter Eisentraut <[email protected]>
1 sibling, 0 replies; 978+ messages in thread
From: Ashutosh Bapat @ 2017-04-25 05:21 UTC (permalink / raw)
To: Peter Eisentraut <[email protected]>; +Cc: David Rowley <[email protected]>; Etsuro Fujita <[email protected]>; pgsql-hackers
On Tue, Apr 25, 2017 at 8:20 AM, Peter Eisentraut
<[email protected]> wrote:
> On 4/14/17 00:24, Ashutosh Bapat wrote:
>> This looks better. Here are patches for master and 9.6.
>> Since join pushdown was supported in 9.6 the patch should be
>> backported to 9.6 as well. Attached is the patch (_96) for 9.6,
>> created by rebasing on 9.6 branch and removing conflict. _v6 is
>> applicable on master.
>
> Committed to PG10. I'll work on backpatching next.
>
Thanks.
--
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 978+ messages in thread
* Re: Foreign Join pushdowns not working properly for outer joins
@ 2017-04-25 14:12 Peter Eisentraut <[email protected]>
parent: Peter Eisentraut <[email protected]>
1 sibling, 2 replies; 978+ messages in thread
From: Peter Eisentraut @ 2017-04-25 14:12 UTC (permalink / raw)
To: Ashutosh Bapat <[email protected]>; David Rowley <[email protected]>; +Cc: Etsuro Fujita <[email protected]>; pgsql-hackers
On 4/24/17 22:50, Peter Eisentraut wrote:
> On 4/14/17 00:24, Ashutosh Bapat wrote:
>> This looks better. Here are patches for master and 9.6.
>> Since join pushdown was supported in 9.6 the patch should be
>> backported to 9.6 as well. Attached is the patch (_96) for 9.6,
>> created by rebasing on 9.6 branch and removing conflict. _v6 is
>> applicable on master.
>
> Committed to PG10. I'll work on backpatching next.
For backpatching to 9.6, I came up with the attached reduced version.
Since we don't have add_foreign_grouping_paths() in 9.6, we can omit the
refactoring and keep the changes much simpler. Does that make sense?
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
^ permalink raw reply [nested|flat] 978+ messages in thread
* Re: Foreign Join pushdowns not working properly for outer joins
@ 2017-04-26 04:56 Ashutosh Bapat <[email protected]>
parent: Peter Eisentraut <[email protected]>
1 sibling, 0 replies; 978+ messages in thread
From: Ashutosh Bapat @ 2017-04-26 04:56 UTC (permalink / raw)
To: Peter Eisentraut <[email protected]>; +Cc: David Rowley <[email protected]>; Etsuro Fujita <[email protected]>; pgsql-hackers
On Tue, Apr 25, 2017 at 7:42 PM, Peter Eisentraut
<[email protected]> wrote:
> On 4/24/17 22:50, Peter Eisentraut wrote:
>> On 4/14/17 00:24, Ashutosh Bapat wrote:
>>> This looks better. Here are patches for master and 9.6.
>>> Since join pushdown was supported in 9.6 the patch should be
>>> backported to 9.6 as well. Attached is the patch (_96) for 9.6,
>>> created by rebasing on 9.6 branch and removing conflict. _v6 is
>>> applicable on master.
>>
>> Committed to PG10. I'll work on backpatching next.
>
> For backpatching to 9.6, I came up with the attached reduced version.
> Since we don't have add_foreign_grouping_paths() in 9.6, we can omit the
> refactoring and keep the changes much simpler. Does that make sense?
Looks good to me.
There's minor complaint. In case we change the option related
functions in master because of a bug, backpatching those changes to
9.6 may not be straightforward. There's very less chance that we will
require to change those functions, so may be we can take that
theoretical risk.
--
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 978+ messages in thread
* Re: Foreign Join pushdowns not working properly for outer joins
@ 2017-04-26 08:32 David Rowley <[email protected]>
parent: Peter Eisentraut <[email protected]>
1 sibling, 1 reply; 978+ messages in thread
From: David Rowley @ 2017-04-26 08:32 UTC (permalink / raw)
To: Peter Eisentraut <[email protected]>; +Cc: Ashutosh Bapat <[email protected]>; Etsuro Fujita <[email protected]>; pgsql-hackers
On 26 April 2017 at 02:12, Peter Eisentraut
<[email protected]> wrote:
> On 4/24/17 22:50, Peter Eisentraut wrote:
>> On 4/14/17 00:24, Ashutosh Bapat wrote:
>>> This looks better. Here are patches for master and 9.6.
>>> Since join pushdown was supported in 9.6 the patch should be
>>> backported to 9.6 as well. Attached is the patch (_96) for 9.6,
>>> created by rebasing on 9.6 branch and removing conflict. _v6 is
>>> applicable on master.
>>
>> Committed to PG10. I'll work on backpatching next.
>
> For backpatching to 9.6, I came up with the attached reduced version.
> Since we don't have add_foreign_grouping_paths() in 9.6, we can omit the
> refactoring and keep the changes much simpler. Does that make sense?
That makes sense to me. It fixes the reported issue and is less
invasive than the pg10 patch.
--
David Rowley http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 978+ messages in thread
* Re: Foreign Join pushdowns not working properly for outer joins
@ 2017-04-26 13:31 Peter Eisentraut <[email protected]>
parent: David Rowley <[email protected]>
0 siblings, 1 reply; 978+ messages in thread
From: Peter Eisentraut @ 2017-04-26 13:31 UTC (permalink / raw)
To: David Rowley <[email protected]>; +Cc: Ashutosh Bapat <[email protected]>; Etsuro Fujita <[email protected]>; pgsql-hackers
On 4/26/17 04:32, David Rowley wrote:
>> For backpatching to 9.6, I came up with the attached reduced version.
>> Since we don't have add_foreign_grouping_paths() in 9.6, we can omit the
>> refactoring and keep the changes much simpler. Does that make sense?
>
> That makes sense to me. It fixes the reported issue and is less
> invasive than the pg10 patch.
committed
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 978+ messages in thread
* Re: Foreign Join pushdowns not working properly for outer joins
@ 2017-04-26 23:09 David Rowley <[email protected]>
parent: Peter Eisentraut <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: David Rowley @ 2017-04-26 23:09 UTC (permalink / raw)
To: Peter Eisentraut <[email protected]>; +Cc: Ashutosh Bapat <[email protected]>; Etsuro Fujita <[email protected]>; pgsql-hackers
On 27 April 2017 at 01:31, Peter Eisentraut
<[email protected]> wrote:
> committed
Great. Thanks!
--
David Rowley http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 978+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 978+ messages in thread
end of thread, other threads:[~2026-03-12 15:09 UTC | newest]
Thread overview: 978+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-04-12 06:48 Re: Foreign Join pushdowns not working properly for outer joins David Rowley <[email protected]>
2017-04-12 09:45 ` Ashutosh Bapat <[email protected]>
2017-04-12 12:57 ` David Rowley <[email protected]>
2017-04-12 13:04 ` Ashutosh Bapat <[email protected]>
2017-04-12 23:22 ` Peter Eisentraut <[email protected]>
2017-04-13 02:05 ` David Rowley <[email protected]>
2017-04-14 04:24 ` Ashutosh Bapat <[email protected]>
2017-04-25 02:50 ` Peter Eisentraut <[email protected]>
2017-04-25 05:21 ` Ashutosh Bapat <[email protected]>
2017-04-25 14:12 ` Peter Eisentraut <[email protected]>
2017-04-26 04:56 ` Ashutosh Bapat <[email protected]>
2017-04-26 08:32 ` David Rowley <[email protected]>
2017-04-26 13:31 ` Peter Eisentraut <[email protected]>
2017-04-26 23:09 ` David Rowley <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess 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