Skip to content

Commit 2e0cc1f

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 185b744 commit 2e0cc1f

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
@@ -5989,9 +5989,10 @@ GetXLogReceiptTime(TimestampTz *rtime, bool *fromStream)
59895989
*/
59905990
#define RecoveryRequiresIntParameter(param_name, currValue, minValue) \
59915991
do { \
5992-
if (currValue < minValue) \
5992+
if ((currValue) < (minValue)) \
59935993
ereport(ERROR, \
5994-
(errmsg("hot standby is not possible because " \
5994+
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), \
5995+
errmsg("hot standby is not possible because " \
59955996
"%s = %d is a lower setting than on the master server " \
59965997
"(its value was %d)", \
59975998
param_name, \
@@ -6032,10 +6033,10 @@ CheckRequiredParameterValues(void)
60326033
RecoveryRequiresIntParameter("max_connections",
60336034
MaxConnections,
60346035
ControlFile->MaxConnections);
6035-
RecoveryRequiresIntParameter("max_prepared_xacts",
6036+
RecoveryRequiresIntParameter("max_prepared_transactions",
60366037
max_prepared_xacts,
60376038
ControlFile->max_prepared_xacts);
6038-
RecoveryRequiresIntParameter("max_locks_per_xact",
6039+
RecoveryRequiresIntParameter("max_locks_per_transaction",
60396040
max_locks_per_xact,
60406041
ControlFile->max_locks_per_xact);
60416042
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy