Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 987277f

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 f7b13e4 commit 987277f

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
@@ -5645,9 +5645,10 @@ GetXLogReceiptTime(TimestampTz *rtime, bool *fromStream)
56455645
*/
56465646
#define RecoveryRequiresIntParameter(param_name, currValue, minValue) \
56475647
do { \
5648-
if (currValue < minValue) \
5648+
if ((currValue) < (minValue)) \
56495649
ereport(ERROR, \
5650-
(errmsg("hot standby is not possible because " \
5650+
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), \
5651+
errmsg("hot standby is not possible because " \
56515652
"%s = %d is a lower setting than on the master server " \
56525653
"(its value was %d)", \
56535654
param_name, \
@@ -5688,10 +5689,10 @@ CheckRequiredParameterValues(void)
56885689
RecoveryRequiresIntParameter("max_connections",
56895690
MaxConnections,
56905691
ControlFile->MaxConnections);
5691-
RecoveryRequiresIntParameter("max_prepared_xacts",
5692+
RecoveryRequiresIntParameter("max_prepared_transactions",
56925693
max_prepared_xacts,
56935694
ControlFile->max_prepared_xacts);
5694-
RecoveryRequiresIntParameter("max_locks_per_xact",
5695+
RecoveryRequiresIntParameter("max_locks_per_transaction",
56955696
max_locks_per_xact,
56965697
ControlFile->max_locks_per_xact);
56975698
}

0 commit comments

Comments
 (0)