v1-0001-Fix-quotation-of-variable-names.patch
application/octet-stream
Filename: v1-0001-Fix-quotation-of-variable-names.patch
Type: application/octet-stream
Part: 0
Message:
Re: About a recently-added message
Patch
Format: format-patch
Series: patch v1-0001
Subject: Fix quotation of variable names.
| File | + | − |
|---|---|---|
| src/backend/replication/logical/slotsync.c | 13 | 16 |
| src/test/recovery/t/040_standby_failover_slots_sync.pl | 1 | 1 |
From d15d7d9a33bfec7c4764fe9601822d69dd386b5e Mon Sep 17 00:00:00 2001
From: Shveta Malik <shveta.malik@gmail.com>
Date: Wed, 14 Feb 2024 17:29:25 +0530
Subject: [PATCH v1] Fix quotation of variable names.
This patch corrects the usage of double quotes for variable
names and values added by commit ddd5f4f54a.
---
src/backend/replication/logical/slotsync.c | 29 +++++++++----------
.../t/040_standby_failover_slots_sync.pl | 2 +-
2 files changed, 14 insertions(+), 17 deletions(-)
diff --git a/src/backend/replication/logical/slotsync.c b/src/backend/replication/logical/slotsync.c
index 0aa1bf1ad2..5e82c02484 100644
--- a/src/backend/replication/logical/slotsync.c
+++ b/src/backend/replication/logical/slotsync.c
@@ -729,12 +729,12 @@ validate_remote_info(WalReceiverConn *wrconn)
ereport(ERROR,
errmsg("could not fetch primary_slot_name \"%s\" info from the primary server: %s",
PrimarySlotName, res->err),
- errhint("Check if \"primary_slot_name\" is configured correctly."));
+ errhint("Check if primary_slot_name is configured correctly."));
tupslot = MakeSingleTupleTableSlot(res->tupledesc, &TTSOpsMinimalTuple);
if (!tuplestore_gettupleslot(res->tuplestore, true, false, tupslot))
elog(ERROR,
- "failed to fetch tuple for the primary server slot specified by \"primary_slot_name\"");
+ "failed to fetch tuple for the primary server slot specified by primary_slot_name");
remote_in_recovery = DatumGetBool(slot_getattr(tupslot, 1, &isnull));
Assert(!isnull);
@@ -750,9 +750,9 @@ validate_remote_info(WalReceiverConn *wrconn)
if (!primary_slot_valid)
ereport(ERROR,
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("bad configuration for slot synchronization"),
+ errmsg("slot synchronization requires valid primary_slot_name"),
/* translator: second %s is a GUC variable name */
- errdetail("The replication slot \"%s\" specified by \"%s\" does not exist on the primary server.",
+ errdetail("The replication slot \"%s\" specified by %s does not exist on the primary server.",
PrimarySlotName, "primary_slot_name"));
ExecClearTuple(tupslot);
@@ -778,8 +778,7 @@ ValidateSlotSyncParams(void)
ereport(ERROR,
/* translator: %s is a GUC variable name */
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("bad configuration for slot synchronization"),
- errhint("\"%s\" must be defined.", "primary_slot_name"));
+ errmsg("slot synchronization requires %s to be defined", "primary_slot_name"));
/*
* hot_standby_feedback must be enabled to cooperate with the physical
@@ -790,15 +789,14 @@ ValidateSlotSyncParams(void)
ereport(ERROR,
/* translator: %s is a GUC variable name */
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("bad configuration for slot synchronization"),
- errhint("\"%s\" must be enabled.", "hot_standby_feedback"));
+ errmsg("slot synchronization requires %s to be enabled",
+ "hot_standby_feedback"));
/* Logical slot sync/creation requires wal_level >= logical. */
if (wal_level < WAL_LEVEL_LOGICAL)
ereport(ERROR,
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("bad configuration for slot synchronization"),
- errhint("\"wal_level\" must be >= logical."));
+ errmsg("slot synchronization requires wal_level >= logical"));
/*
* The primary_conninfo is required to make connection to primary for
@@ -808,8 +806,8 @@ ValidateSlotSyncParams(void)
ereport(ERROR,
/* translator: %s is a GUC variable name */
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("bad configuration for slot synchronization"),
- errhint("\"%s\" must be defined.", "primary_conninfo"));
+ errmsg("slot synchronization requires %s to be defined",
+ "primary_conninfo"));
/*
* The slot synchronization needs a database connection for walrcv_exec to
@@ -820,12 +818,11 @@ ValidateSlotSyncParams(void)
ereport(ERROR,
/*
- * translator: 'dbname' is a specific option; %s is a GUC variable
- * name
+ * translator: dbname is a specific option; %s is a GUC variable name
*/
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("bad configuration for slot synchronization"),
- errhint("'dbname' must be specified in \"%s\".", "primary_conninfo"));
+ errmsg("slot synchronization requires dbname to be specified in %s",
+ "primary_conninfo"));
}
/*
diff --git a/src/test/recovery/t/040_standby_failover_slots_sync.pl b/src/test/recovery/t/040_standby_failover_slots_sync.pl
index 9634a50b3e..e9b66a5a41 100644
--- a/src/test/recovery/t/040_standby_failover_slots_sync.pl
+++ b/src/test/recovery/t/040_standby_failover_slots_sync.pl
@@ -305,7 +305,7 @@ $standby1->reload;
($result, $stdout, $stderr) =
$standby1->psql('postgres', "SELECT pg_sync_replication_slots();");
ok( $stderr =~
- /HINT: 'dbname' must be specified in "primary_conninfo"/,
+ /ERROR: slot synchronization requires dbname to be specified in primary_conninfo/,
"cannot sync slots if dbname is not specified in primary_conninfo");
##################################################
--
2.34.1