Skip to content

Commit 308d4ec

Browse files
committed
Fix inappropriate error messages for Hot Standby misconfiguration errors.
Give the correct name of the GUC parameter being complained of. Also, emit a more suitable SQLSTATE (INVALID_PARAMETER_VALUE, not the default INTERNAL_ERROR). Gurjeet Singh, errcode adjustment by me
1 parent 8a66a37 commit 308d4ec

File tree

1 file changed

+5
-4
lines changed
  • src/backend/access/transam

1 file changed

+5
-4
lines changed

src/backend/access/transam/xlog.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5990,9 +5990,10 @@ GetXLogReceiptTime(TimestampTz *rtime, bool *fromStream)
59905990
*/
59915991
#define RecoveryRequiresIntParameter(param_name, currValue, minValue) \
59925992
do { \
5993-
if (currValue < minValue) \
5993+
if ((currValue) < (minValue)) \
59945994
ereport(ERROR, \
5995-
(errmsg("hot standby is not possible because " \
5995+
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), \
5996+
errmsg("hot standby is not possible because " \
59965997
"%s = %d is a lower setting than on the master server " \
59975998
"(its value was %d)", \
59985999
param_name, \
@@ -6033,10 +6034,10 @@ CheckRequiredParameterValues(void)
60336034
RecoveryRequiresIntParameter("max_connections",
60346035
MaxConnections,
60356036
ControlFile->MaxConnections);
6036-
RecoveryRequiresIntParameter("max_prepared_xacts",
6037+
RecoveryRequiresIntParameter("max_prepared_transactions",
60376038
max_prepared_xacts,
60386039
ControlFile->max_prepared_xacts);
6039-
RecoveryRequiresIntParameter("max_locks_per_xact",
6040+
RecoveryRequiresIntParameter("max_locks_per_transaction",
60406041
max_locks_per_xact,
60416042
ControlFile->max_locks_per_xact);
60426043
}

0 commit comments

Comments
 (0)