aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2012-09-05 21:49:08 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2012-09-05 21:49:08 -0400
commit2e0cc1f031387fc304d11e55df0f9566d91698ff (patch)
tree872ceb1ed84f4e394d217c2cb6355004fac37ff8 /src
parent185b744ee6115537e005b3d0d5e642c2146a12c1 (diff)
downloadpostgresql-2e0cc1f031387fc304d11e55df0f9566d91698ff.tar.gz
postgresql-2e0cc1f031387fc304d11e55df0f9566d91698ff.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/backend/access/transam/xlog.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 911ea8a2865..787eda2a61e 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -5989,9 +5989,10 @@ GetXLogReceiptTime(TimestampTz *rtime, bool *fromStream)
*/
#define RecoveryRequiresIntParameter(param_name, currValue, minValue) \
do { \
- if (currValue < minValue) \
+ if ((currValue) < (minValue)) \
ereport(ERROR, \
- (errmsg("hot standby is not possible because " \
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE), \
+ errmsg("hot standby is not possible because " \
"%s = %d is a lower setting than on the master server " \
"(its value was %d)", \
param_name, \
@@ -6032,10 +6033,10 @@ CheckRequiredParameterValues(void)
RecoveryRequiresIntParameter("max_connections",
MaxConnections,
ControlFile->MaxConnections);
- RecoveryRequiresIntParameter("max_prepared_xacts",
+ RecoveryRequiresIntParameter("max_prepared_transactions",
max_prepared_xacts,
ControlFile->max_prepared_xacts);
- RecoveryRequiresIntParameter("max_locks_per_xact",
+ RecoveryRequiresIntParameter("max_locks_per_transaction",
max_locks_per_xact,
ControlFile->max_locks_per_xact);
}