v1-0001-Simplify-the-code-building-the-conflict-messages.patch
application/octet-stream
Filename: v1-0001-Simplify-the-code-building-the-conflict-messages.patch
Type: application/octet-stream
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: format-patch
Series: patch v1-0001
Subject: Simplify the code building the conflict messages
| File | + | − |
|---|---|---|
| src/backend/replication/logical/conflict.c | 8 | 31 |
From f5bdcbc593ae7925c505a2907cc2ea9dd1750532 Mon Sep 17 00:00:00 2001
From: Peter Smith <peter.b.smith@fujitsu.com>
Date: Fri, 28 Nov 2025 12:23:59 +1100
Subject: [PATCH v1] Simplify the code building the conflict messages
---
src/backend/replication/logical/conflict.c | 39 ++++++------------------------
1 file changed, 8 insertions(+), 31 deletions(-)
diff --git a/src/backend/replication/logical/conflict.c b/src/backend/replication/logical/conflict.c
index 1669559..9d726c5 100644
--- a/src/backend/replication/logical/conflict.c
+++ b/src/backend/replication/logical/conflict.c
@@ -379,19 +379,9 @@ build_tuple_value_details(EState *estate, ResultRelInfo *relinfo,
NULL, 64);
if (desc)
- {
- if (tuple_value.len > 0)
- {
- appendStringInfoString(&tuple_value, "; ");
- appendStringInfo(&tuple_value, _("existing local row %s"),
- desc);
- }
- else
- {
- appendStringInfo(&tuple_value, _("Existing local row %s"),
- desc);
- }
- }
+ appendStringInfo(&tuple_value, tuple_value.len > 0
+ ? _("; existing local row %s")
+ : _("Existing local row %s"), desc);
}
if (remoteslot)
@@ -411,17 +401,9 @@ build_tuple_value_details(EState *estate, ResultRelInfo *relinfo,
modifiedCols, 64);
if (desc)
- {
- if (tuple_value.len > 0)
- {
- appendStringInfoString(&tuple_value, "; ");
- appendStringInfo(&tuple_value, _("remote row %s"), desc);
- }
- else
- {
- appendStringInfo(&tuple_value, _("Remote row %s"), desc);
- }
- }
+ appendStringInfo(&tuple_value, tuple_value.len > 0
+ ? _("; remote row %s")
+ : _("Remote row %s"), desc);
}
if (searchslot)
@@ -450,18 +432,13 @@ build_tuple_value_details(EState *estate, ResultRelInfo *relinfo,
if (desc)
{
if (tuple_value.len > 0)
- {
- appendStringInfoString(&tuple_value, "; ");
appendStringInfo(&tuple_value, OidIsValid(replica_index)
- ? _("replica identity %s")
- : _("replica identity full %s"), desc);
- }
+ ? _("; replica identity %s")
+ : _("; replica identity full %s"), desc);
else
- {
appendStringInfo(&tuple_value, OidIsValid(replica_index)
? _("Replica identity %s")
: _("Replica identity full %s"), desc);
- }
}
}
--
1.8.3.1