diff --git a/src/backend/access/transam/parallel.c b/src/backend/access/transam/parallel.c
index 5edaaf4bd2addca4c5f5e61fea9dd9e8047f7db4..7c8efba54fc4eb8c59bf57c30aaad3cbf19529d7 100644
--- a/src/backend/access/transam/parallel.c
+++ b/src/backend/access/transam/parallel.c
@@ -907,12 +907,12 @@ ParallelWorkerMain(Datum main_arg)
 	if (seg == NULL)
 		ereport(ERROR,
 				(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
-				 errmsg("unable to map dynamic shared memory segment")));
+				 errmsg("could not map dynamic shared memory segment")));
 	toc = shm_toc_attach(PARALLEL_MAGIC, dsm_segment_address(seg));
 	if (toc == NULL)
 		ereport(ERROR,
 				(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
-			   errmsg("bad magic number in dynamic shared memory segment")));
+			   errmsg("invalid magic number in dynamic shared memory segment")));
 
 	/* Look up fixed parallel state. */
 	fps = shm_toc_lookup(toc, PARALLEL_KEY_FIXED);
@@ -1063,7 +1063,7 @@ ParallelExtensionTrampoline(dsm_segment *seg, shm_toc *toc)
 static void
 ParallelErrorContext(void *arg)
 {
-	errcontext("parallel worker, pid %d", *(int32 *) arg);
+	errcontext("parallel worker, PID %d", *(int32 *) arg);
 }
 
 /*
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 08d16823ed105374023c405dcfd8afcb3bd83bcf..f17f83417d1d7b00ce8f8ce10f7e9e7d8387aa3e 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -4976,9 +4976,10 @@ readRecoveryCommandFile(void)
 			else
 				ereport(ERROR,
 						(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-						 errmsg("invalid value for recovery parameter \"%s\"",
-								"recovery_target_action"),
-						 errhint("The allowed values are \"pause\", \"promote\", and \"shutdown\".")));
+						 errmsg("invalid value for recovery parameter \"%s\": \"%s\"",
+								"recovery_target_action",
+								item->value),
+						 errhint("Valid values are \"pause\", \"promote\", and \"shutdown\".")));
 
 			ereport(DEBUG2,
 					(errmsg_internal("recovery_target_action = '%s'",
@@ -5058,7 +5059,9 @@ readRecoveryCommandFile(void)
 			else
 				ereport(ERROR,
 						(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-						 errmsg("invalid value for recovery parameter \"recovery_target\""),
+						 errmsg("invalid value for recovery parameter \"%s\": \"%s\"",
+								"recovery_target",
+								item->value),
 					   errhint("The only allowed value is \"immediate\".")));
 			ereport(DEBUG2,
 					(errmsg_internal("recovery_target = '%s'",
@@ -6142,7 +6145,7 @@ StartupXLOG(void)
 			unlink(TABLESPACE_MAP_OLD);
 			if (rename(TABLESPACE_MAP, TABLESPACE_MAP_OLD) == 0)
 				ereport(LOG,
-					(errmsg("ignoring \"%s\" file because no \"%s\" file exists",
+					(errmsg("ignoring file \"%s\" because no file \"%s\" exists",
 							TABLESPACE_MAP, BACKUP_LABEL_FILE),
 					 errdetail("File \"%s\" was renamed to \"%s\".",
 							   TABLESPACE_MAP, TABLESPACE_MAP_OLD)));
@@ -6150,7 +6153,7 @@ StartupXLOG(void)
 				ereport(LOG,
 						(errmsg("ignoring \"%s\" file because no \"%s\" file exists",
 								TABLESPACE_MAP, BACKUP_LABEL_FILE),
-						 errdetail("File \"%s\" could not be renamed to \"%s\": %m.",
+						 errdetail("Could not rename file \"%s\" to \"%s\": %m.",
 								   TABLESPACE_MAP, TABLESPACE_MAP_OLD)));
 		}
 
@@ -6281,24 +6284,24 @@ StartupXLOG(void)
 	LastRec = RecPtr = checkPointLoc;
 
 	ereport(DEBUG1,
-			(errmsg("redo record is at %X/%X; shutdown %s",
+			(errmsg_internal("redo record is at %X/%X; shutdown %s",
 				  (uint32) (checkPoint.redo >> 32), (uint32) checkPoint.redo,
 					wasShutdown ? "TRUE" : "FALSE")));
 	ereport(DEBUG1,
-			(errmsg("next transaction ID: %u/%u; next OID: %u",
+			(errmsg_internal("next transaction ID: %u/%u; next OID: %u",
 					checkPoint.nextXidEpoch, checkPoint.nextXid,
 					checkPoint.nextOid)));
 	ereport(DEBUG1,
-			(errmsg("next MultiXactId: %u; next MultiXactOffset: %u",
+			(errmsg_internal("next MultiXactId: %u; next MultiXactOffset: %u",
 					checkPoint.nextMulti, checkPoint.nextMultiOffset)));
 	ereport(DEBUG1,
-			(errmsg("oldest unfrozen transaction ID: %u, in database %u",
+			(errmsg_internal("oldest unfrozen transaction ID: %u, in database %u",
 					checkPoint.oldestXid, checkPoint.oldestXidDB)));
 	ereport(DEBUG1,
-			(errmsg("oldest MultiXactId: %u, in database %u",
+			(errmsg_internal("oldest MultiXactId: %u, in database %u",
 					checkPoint.oldestMulti, checkPoint.oldestMultiDB)));
 	ereport(DEBUG1,
-			(errmsg("commit timestamp Xid oldest/newest: %u/%u",
+			(errmsg_internal("commit timestamp Xid oldest/newest: %u/%u",
 					checkPoint.oldestCommitTs,
 					checkPoint.newestCommitTs)));
 	if (!TransactionIdIsNormal(checkPoint.nextXid))
diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c
index fc56f1ec3cfdecaaf8c4c7f67c976cff6c7681d8..b90faa6e72ce1bdec6f93f3fc334054bb92cadd3 100644
--- a/src/backend/catalog/objectaddress.c
+++ b/src/backend/catalog/objectaddress.c
@@ -1652,7 +1652,7 @@ get_object_address_usermapping(List *objname, List *objargs, bool missing_ok)
 			if (!missing_ok)
 				ereport(ERROR,
 						(errcode(ERRCODE_UNDEFINED_OBJECT),
-						 errmsg("user mapping for user \"%s\" in server \"%s\" does not exist",
+						 errmsg("user mapping for user \"%s\" on server \"%s\" does not exist",
 								username, servername)));
 			return address;
 		}
@@ -1678,7 +1678,7 @@ get_object_address_usermapping(List *objname, List *objargs, bool missing_ok)
 		if (!missing_ok)
 			ereport(ERROR,
 					(errcode(ERRCODE_UNDEFINED_OBJECT),
-					 errmsg("user mapping for user \"%s\" in server \"%s\" does not exist",
+					 errmsg("user mapping for user \"%s\" on server \"%s\" does not exist",
 							username, servername)));
 		return address;
 	}
diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c
index 443b9e7376fef2083547a7b97eb5d29ffa578e72..66e9f8b4ea6505fb806b92822638825b5a32d74f 100644
--- a/src/backend/commands/copy.c
+++ b/src/backend/commands/copy.c
@@ -874,7 +874,7 @@ DoCopy(const CopyStmt *stmt, const char *queryString, uint64 *processed)
 			if (is_from)
 				ereport(ERROR,
 						(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-				  errmsg("COPY FROM not supported with row level security."),
+				  errmsg("COPY FROM not supported with row-level security."),
 						 errhint("Use INSERT statements instead.")));
 
 			/* Build target list */
diff --git a/src/backend/commands/extension.c b/src/backend/commands/extension.c
index 67b16a7a68d3d0a75e0eeda2da1db3769b3957bd..5bdf25fc0fd4ad4e3fc96b811bc3c1450ed5a30d 100644
--- a/src/backend/commands/extension.c
+++ b/src/backend/commands/extension.c
@@ -3111,7 +3111,7 @@ read_whole_file(const char *filename, int *length)
 	if (fst.st_size > (MaxAllocSize - 1))
 		ereport(ERROR,
 				(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
-				 errmsg("file too large")));
+				 errmsg("file \"%s\" is too large", filename)));
 	bytes_to_read = (size_t) fst.st_size;
 
 	if ((file = AllocateFile(filename, PG_BINARY_R)) == NULL)
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index 55ab2096cc328222b7cb3aaafb63f6dac5bcb0d5..44ea7311639a6c7823b8fc31f192666f3f56cbf1 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -11213,10 +11213,8 @@ ATPrepChangePersistence(Relation rel, bool toLogged)
 		case RELPERSISTENCE_TEMP:
 			ereport(ERROR,
 					(errcode(ERRCODE_INVALID_TABLE_DEFINITION),
-					 errmsg("cannot change logged status of table %s",
+					 errmsg("cannot change logged status of table \"%s\" because it is temporary",
 							RelationGetRelationName(rel)),
-					 errdetail("Table %s is temporary.",
-							   RelationGetRelationName(rel)),
 					 errtable(rel)));
 			break;
 		case RELPERSISTENCE_PERMANENT:
@@ -11274,11 +11272,9 @@ ATPrepChangePersistence(Relation rel, bool toLogged)
 				if (foreignrel->rd_rel->relpersistence != RELPERSISTENCE_PERMANENT)
 					ereport(ERROR,
 							(errcode(ERRCODE_INVALID_TABLE_DEFINITION),
-						 errmsg("cannot change status of table %s to logged",
-								RelationGetRelationName(rel)),
-						  errdetail("Table %s references unlogged table %s.",
-									RelationGetRelationName(rel),
-									RelationGetRelationName(foreignrel)),
+						 errmsg("could not change table \"%s\" to logged because it references unlogged table \"%s\"",
+								RelationGetRelationName(rel),
+								RelationGetRelationName(foreignrel)),
 							 errtableconstraint(rel, NameStr(con->conname))));
 			}
 			else
@@ -11286,11 +11282,9 @@ ATPrepChangePersistence(Relation rel, bool toLogged)
 				if (foreignrel->rd_rel->relpersistence == RELPERSISTENCE_PERMANENT)
 					ereport(ERROR,
 							(errcode(ERRCODE_INVALID_TABLE_DEFINITION),
-					   errmsg("cannot change status of table %s to unlogged",
-							  RelationGetRelationName(rel)),
-					  errdetail("Logged table %s is referenced by table %s.",
-								RelationGetRelationName(foreignrel),
-								RelationGetRelationName(rel)),
+					   errmsg("could not change table \"%s\" to unlogged because it references logged table \"%s\"",
+							  RelationGetRelationName(rel),
+							  RelationGetRelationName(foreignrel)),
 							 errtableconstraint(rel, NameStr(con->conname))));
 			}
 
diff --git a/src/backend/commands/tablespace.c b/src/backend/commands/tablespace.c
index 18ae4ab10af48f2a75d99f2cc82be17c97b10b9e..137aec255f4178c585dfa880a52fe518767f69a9 100644
--- a/src/backend/commands/tablespace.c
+++ b/src/backend/commands/tablespace.c
@@ -800,7 +800,7 @@ remove_symlink:
 		/* Refuse to remove anything that's not a directory or symlink */
 		ereport(redo ? LOG : ERROR,
 				(ERRCODE_SYSTEM_ERROR,
-				 errmsg("not a directory or symbolic link: \"%s\"",
+				 errmsg("\"%s\" is not a directory or symbolic link",
 						linkloc)));
 	}
 
@@ -886,7 +886,7 @@ remove_tablespace_symlink(const char *linkloc)
 	{
 		/* Refuse to remove anything that's not a directory or symlink */
 		ereport(ERROR,
-				(errmsg("not a directory or symbolic link: \"%s\"",
+				(errmsg("\"%s\" is not a directory or symbolic link",
 						linkloc)));
 	}
 }
diff --git a/src/backend/libpq/auth.c b/src/backend/libpq/auth.c
index aca4ffe4c7e9e832fc5cd396380b764d6014ca80..cdc5bf129a280fe1b395bb64818a5418ff3adb8f 100644
--- a/src/backend/libpq/auth.c
+++ b/src/backend/libpq/auth.c
@@ -668,8 +668,7 @@ recv_password_packet(Port *port)
 				 errmsg("invalid password packet size")));
 
 	/* Do not echo password to logs, for security. */
-	ereport(DEBUG5,
-			(errmsg("received password packet")));
+	elog(DEBUG5, "received password packet");
 
 	/*
 	 * Return the received string.  Note we do not attempt to do any
diff --git a/src/backend/libpq/pqcomm.c b/src/backend/libpq/pqcomm.c
index 63673b16dfbdb4d8d04304c03dccc6d47105bde9..0be94b008c8e02df14b28f4fc522d2a50e025379 100644
--- a/src/backend/libpq/pqcomm.c
+++ b/src/backend/libpq/pqcomm.c
@@ -1168,7 +1168,7 @@ pq_startmsgread(void)
 	if (PqCommReadingMsg)
 		ereport(FATAL,
 				(errcode(ERRCODE_PROTOCOL_VIOLATION),
-		   errmsg("terminating connection because protocol sync was lost")));
+		   errmsg("terminating connection because protocol synchronization was lost")));
 
 	PqCommReadingMsg = true;
 }
diff --git a/src/backend/parser/parse_agg.c b/src/backend/parser/parse_agg.c
index 5b0d568478bd61ed3e4f1850b685521904473a21..2c45bd67a163e418e00c5ec48a952334db0c36b4 100644
--- a/src/backend/parser/parse_agg.c
+++ b/src/backend/parser/parse_agg.c
@@ -979,7 +979,7 @@ parseCheckAggregates(ParseState *pstate, Query *qry)
 		if (!gsets)
 			ereport(ERROR,
 					(errcode(ERRCODE_STATEMENT_TOO_COMPLEX),
-					 errmsg("too many grouping sets present (max 4096)"),
+					 errmsg("too many grouping sets present (maximum 4096)"),
 					 parser_errposition(pstate,
 										qry->groupClause
 									? exprLocation((Node *) qry->groupClause)
diff --git a/src/backend/parser/parse_clause.c b/src/backend/parser/parse_clause.c
index 9c2846dc337e11f734cb5c9ea8ce793115c3045f..45d5e6cb0ff4fcc6a44d10970c2fbb3a02366bdd 100644
--- a/src/backend/parser/parse_clause.c
+++ b/src/backend/parser/parse_clause.c
@@ -2856,7 +2856,7 @@ transformOnConflictArbiter(ParseState *pstate,
 		ereport(ERROR,
 				(errcode(ERRCODE_SYNTAX_ERROR),
 				 errmsg("ON CONFLICT DO UPDATE requires inference specification or constraint name"),
-				 errhint("For example, ON CONFLICT (<column>)."),
+				 errhint("For example, ON CONFLICT (column_name)."),
 				 parser_errposition(pstate,
 								  exprLocation((Node *) onConflictClause))));
 
diff --git a/src/backend/parser/parse_relation.c b/src/backend/parser/parse_relation.c
index 0c4ed65afa2e8fd0aa5ac6ebad64e8f2f1491ab7..6f569dad545242e2ca26e063b0e13bba56b43ab5 100644
--- a/src/backend/parser/parse_relation.c
+++ b/src/backend/parser/parse_relation.c
@@ -3080,7 +3080,7 @@ errorMissingColumn(ParseState *pstate,
 				 errmsg("column %s.%s does not exist", relname, colname) :
 				 errmsg("column \"%s\" does not exist", colname),
 				 state->rfirst ? closestfirst ?
-		  errhint("Perhaps you meant to reference the column \"%s\".\"%s\".",
+		  errhint("Perhaps you meant to reference the column \"%s.%s\".",
 				  state->rfirst->eref->aliasname, closestfirst) :
 				 errhint("There is a column named \"%s\" in table \"%s\", but it cannot be referenced from this part of the query.",
 						 colname, state->rfirst->eref->aliasname) : 0,
@@ -3099,7 +3099,7 @@ errorMissingColumn(ParseState *pstate,
 				 relname ?
 				 errmsg("column %s.%s does not exist", relname, colname) :
 				 errmsg("column \"%s\" does not exist", colname),
-				 errhint("Perhaps you meant to reference the column \"%s\".\"%s\" or the column \"%s\".\"%s\".",
+				 errhint("Perhaps you meant to reference the column \"%s.%s\" or the column \"%s.%s\".",
 						 state->rfirst->eref->aliasname, closestfirst,
 						 state->rsecond->eref->aliasname, closestsecond),
 				 parser_errposition(pstate, location)));
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index 90c2f4a5e3286de20047640433779b220d5ee6d6..3cba0e5f50ece7d9135165961306d80e3aa7402e 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -2047,8 +2047,10 @@ retry1:
 				else if (!parse_bool(valptr, &am_walsender))
 					ereport(FATAL,
 							(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-					   errmsg("invalid value for parameter \"replication\""),
-							 errhint("Valid values are: false, 0, true, 1, database.")));
+							 errmsg("invalid value for parameter \"%s\": \"%s\"",
+									"replication",
+									valptr),
+							 errhint("Valid values are: \"false\", 0, \"true\", 1, \"database\".")));
 			}
 			else
 			{
diff --git a/src/backend/storage/lmgr/lwlock.c b/src/backend/storage/lmgr/lwlock.c
index 6bca02c5f213be3f4f3f7156a3bf8d8d43af4b83..b13ebc637c29ef84dd64123e58002f465db39e0a 100644
--- a/src/backend/storage/lmgr/lwlock.c
+++ b/src/backend/storage/lmgr/lwlock.c
@@ -184,7 +184,7 @@ PRINT_LWDEBUG(const char *where, LWLock *lock, LWLockMode mode)
 			ereport(LOG,
 					(errhidestmt(true),
 					 errhidecontext(true),
-					 errmsg("%d: %s(%s): excl %u shared %u haswaiters %u waiters %u rOK %d",
+					 errmsg_internal("%d: %s(%s): excl %u shared %u haswaiters %u waiters %u rOK %d",
 							MyProcPid,
 							where, MainLWLockNames[id],
 							!!(state & LW_VAL_EXCLUSIVE),
@@ -196,7 +196,7 @@ PRINT_LWDEBUG(const char *where, LWLock *lock, LWLockMode mode)
 			ereport(LOG,
 					(errhidestmt(true),
 					 errhidecontext(true),
-					 errmsg("%d: %s(%s %d): excl %u shared %u haswaiters %u waiters %u rOK %d",
+					 errmsg_internal("%d: %s(%s %d): excl %u shared %u haswaiters %u waiters %u rOK %d",
 							MyProcPid,
 							where, T_NAME(lock), id,
 							!!(state & LW_VAL_EXCLUSIVE),
@@ -219,13 +219,13 @@ LOG_LWDEBUG(const char *where, LWLock *lock, const char *msg)
 			ereport(LOG,
 					(errhidestmt(true),
 					 errhidecontext(true),
-					 errmsg("%s(%s): %s", where,
+					 errmsg_internal("%s(%s): %s", where,
 							MainLWLockNames[id], msg)));
 		else
 			ereport(LOG,
 					(errhidestmt(true),
 					 errhidecontext(true),
-					 errmsg("%s(%s %d): %s", where,
+					 errmsg_internal("%s(%s %d): %s", where,
 							T_NAME(lock), id, msg)));
 	}
 }
diff --git a/src/backend/utils/adt/array_userfuncs.c b/src/backend/utils/adt/array_userfuncs.c
index c14ea23dfbc5a72c5760625a3116900cd3397719..d0e0dfdae9ea0fe9124132e5d9d9dd211beebbda 100644
--- a/src/backend/utils/adt/array_userfuncs.c
+++ b/src/backend/utils/adt/array_userfuncs.c
@@ -746,7 +746,7 @@ array_position_common(FunctionCallInfo fcinfo)
 		if (PG_ARGISNULL(2))
 			ereport(ERROR,
 					(errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
-					 errmsg("initial position should not be NULL")));
+					 errmsg("initial position must not be null")));
 
 		position_min = PG_GETARG_INT32(2);
 	}
diff --git a/src/backend/utils/adt/encode.c b/src/backend/utils/adt/encode.c
index 4b32b6cabbb7af05dad40fe57d0f353e43fdc789..f4216fb795054fee7a0f947430aedc4acc6afbfb 100644
--- a/src/backend/utils/adt/encode.c
+++ b/src/backend/utils/adt/encode.c
@@ -304,7 +304,7 @@ b64_decode(const char *src, unsigned len, char *dst)
 			if (b < 0)
 				ereport(ERROR,
 						(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-						 errmsg("invalid symbol '%c' while decoding base64 sequence", (int) c)));
+						 errmsg("invalid symbol \"%c\" while decoding base64 sequence", (int) c)));
 		}
 		/* add it to buffer */
 		buf = (buf << 6) + b;
@@ -325,7 +325,7 @@ b64_decode(const char *src, unsigned len, char *dst)
 		ereport(ERROR,
 				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
 				 errmsg("invalid base64 end sequence"),
-				 errhint("Input data is missing padding, truncated, or otherwise corrupted.")));
+				 errhint("Input data is missing padding, is truncated, or is otherwise corrupted.")));
 
 	return p - dst;
 }
diff --git a/src/backend/utils/adt/jsonb.c b/src/backend/utils/adt/jsonb.c
index 7cbb69faf2ea3920ec3df57a8e1ec527ea4ab93a..0c14a3bfda4ec3a91fe41463655f22c270e4edd9 100644
--- a/src/backend/utils/adt/jsonb.c
+++ b/src/backend/utils/adt/jsonb.c
@@ -1179,7 +1179,7 @@ jsonb_build_object(PG_FUNCTION_ARGS)
 	if (nargs % 2 != 0)
 		ereport(ERROR,
 				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("invalid number or arguments: object must be matched key value pairs")));
+				 errmsg("invalid number of arguments: object must be matched key value pairs")));
 
 	memset(&result, 0, sizeof(JsonbInState));
 
@@ -1193,7 +1193,7 @@ jsonb_build_object(PG_FUNCTION_ARGS)
 		if (PG_ARGISNULL(i))
 			ereport(ERROR,
 					(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-					 errmsg("arg %d: key cannot be null", i + 1)));
+					 errmsg("argument %d: key must not be null", i + 1)));
 		val_type = get_fn_expr_argtype(fcinfo->flinfo, i);
 
 		/*
@@ -1215,7 +1215,7 @@ jsonb_build_object(PG_FUNCTION_ARGS)
 		if (val_type == InvalidOid || val_type == UNKNOWNOID)
 			ereport(ERROR,
 					(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-					 errmsg("arg %d: could not determine data type", i + 1)));
+					 errmsg("argument %d: could not determine data type", i + 1)));
 
 		add_jsonb(arg, false, &result, val_type, true);
 
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index fda0fb94f82803f4026df51e6718117d9e03d082..a185749f9f971667111e5708c972dac988746958 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -2461,7 +2461,7 @@ static struct config_int ConfigureNamesInt[] =
 
 	{
 		{"wal_retrieve_retry_interval", PGC_SIGHUP, REPLICATION_STANDBY,
-			gettext_noop("Sets the time to wait before retrying to retrieve WAL"
+			gettext_noop("Sets the time to wait before retrying to retrieve WAL "
 						 "after a failed attempt."),
 			NULL,
 			GUC_UNIT_MS
@@ -2589,7 +2589,7 @@ static struct config_int ConfigureNamesInt[] =
 
 	{
 		{"ssl_renegotiation_limit", PGC_USERSET, CONN_AUTH_SECURITY,
-			gettext_noop("SSL regenotiation is no longer supported; this can only be 0"),
+			gettext_noop("SSL regenotiation is no longer supported; this can only be 0."),
 			NULL,
 			GUC_NO_SHOW_ALL | GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE,
 		},
@@ -3417,7 +3417,7 @@ static struct config_string ConfigureNamesString[] =
 
 	{
 		{"cluster_name", PGC_POSTMASTER, PROCESS_TITLE,
-			gettext_noop("Sets the name of the cluster which is included in the process title."),
+			gettext_noop("Sets the name of the cluster, which is included in the process title."),
 			NULL,
 			GUC_IS_NAME
 		},
diff --git a/src/backend/utils/misc/rls.c b/src/backend/utils/misc/rls.c
index 6ce92af019948dfba7356654c724679af524bb21..9f2ebfe02fafbc8a53c5f1f468d23d099b8ee4d0 100644
--- a/src/backend/utils/misc/rls.c
+++ b/src/backend/utils/misc/rls.c
@@ -122,7 +122,7 @@ check_enable_rls(Oid relid, Oid checkAsUser, bool noError)
 	if (!row_security && !noError)
 		ereport(ERROR,
 				(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
-				 errmsg("insufficient privilege to bypass row security.")));
+				 errmsg("insufficient privilege to bypass row-level security")));
 
 	/* RLS should be fully enabled for this relation. */
 	return RLS_ENABLED;
diff --git a/src/port/win32error.c b/src/port/win32error.c
index 5002335b2d7c908176c2eec3c4dc46505e3b9d6d..d76504e978c0a64bf6c379b1c24d1873e25eb9fe 100644
--- a/src/port/win32error.c
+++ b/src/port/win32error.c
@@ -186,7 +186,7 @@ _dosmaperr(unsigned long e)
 					(errmsg_internal("mapped win32 error code %lu to %d",
 									 e, doserr)));
 #elif FRONTEND_DEBUG
-			fprintf(stderr, _("mapped win32 error code %lu to %d"), e, doserr);
+			fprintf(stderr, "mapped win32 error code %lu to %d", e, doserr);
 #endif
 			errno = doserr;
 			return;
@@ -198,7 +198,7 @@ _dosmaperr(unsigned long e)
 			(errmsg_internal("unrecognized win32 error code: %lu",
 							 e)));
 #else
-	fprintf(stderr, _("unrecognized win32 error code: %lu"), e);
+	fprintf(stderr, "unrecognized win32 error code: %lu", e);
 #endif
 
 	errno = EINVAL;
diff --git a/src/test/regress/expected/alter_table.out b/src/test/regress/expected/alter_table.out
index 44ce6f564914e57f2c88db318f8a2b08a532ee6d..50b3c456f149004bd36d7a3bc08eadd946b59270 100644
--- a/src/test/regress/expected/alter_table.out
+++ b/src/test/regress/expected/alter_table.out
@@ -551,7 +551,7 @@ create table atacc1 ( test int );
 -- add a check constraint (fails)
 alter table atacc1 add constraint atacc_test1 check (test1>3);
 ERROR:  column "test1" does not exist
-HINT:  Perhaps you meant to reference the column "atacc1"."test".
+HINT:  Perhaps you meant to reference the column "atacc1.test".
 drop table atacc1;
 -- something a little more complicated
 create table atacc1 ( test int, test2 int, test3 int);
@@ -1358,7 +1358,7 @@ select f1 from c1;
 ERROR:  column "f1" does not exist
 LINE 1: select f1 from c1;
                ^
-HINT:  Perhaps you meant to reference the column "c1"."f2".
+HINT:  Perhaps you meant to reference the column "c1.f2".
 drop table p1 cascade;
 NOTICE:  drop cascades to table c1
 create table p1 (f1 int, f2 int);
@@ -1372,7 +1372,7 @@ select f1 from c1;
 ERROR:  column "f1" does not exist
 LINE 1: select f1 from c1;
                ^
-HINT:  Perhaps you meant to reference the column "c1"."f2".
+HINT:  Perhaps you meant to reference the column "c1.f2".
 drop table p1 cascade;
 NOTICE:  drop cascades to table c1
 create table p1 (f1 int, f2 int);
@@ -2601,8 +2601,7 @@ CREATE UNLOGGED TABLE unlogged2(f1 SERIAL PRIMARY KEY, f2 INTEGER REFERENCES unl
 CREATE UNLOGGED TABLE unlogged3(f1 SERIAL PRIMARY KEY, f2 INTEGER REFERENCES unlogged3); -- self-referencing foreign key
 ALTER TABLE unlogged3 SET LOGGED; -- skip self-referencing foreign key
 ALTER TABLE unlogged2 SET LOGGED; -- fails because a foreign key to an unlogged table exists
-ERROR:  cannot change status of table unlogged2 to logged
-DETAIL:  Table unlogged2 references unlogged table unlogged1.
+ERROR:  could not change table "unlogged2" to logged because it references unlogged table "unlogged1"
 ALTER TABLE unlogged1 SET LOGGED;
 -- check relpersistence of an unlogged table after changing to permament
 SELECT relname, relkind, relpersistence FROM pg_class WHERE relname ~ '^unlogged1'
@@ -2645,8 +2644,7 @@ ORDER BY relname;
 CREATE TABLE logged2(f1 SERIAL PRIMARY KEY, f2 INTEGER REFERENCES logged1); -- foreign key
 CREATE TABLE logged3(f1 SERIAL PRIMARY KEY, f2 INTEGER REFERENCES logged3); -- self-referencing foreign key
 ALTER TABLE logged1 SET UNLOGGED; -- fails because a foreign key from a permanent table exists
-ERROR:  cannot change status of table logged1 to unlogged
-DETAIL:  Logged table logged2 is referenced by table logged1.
+ERROR:  could not change table "logged1" to unlogged because it references logged table "logged2"
 ALTER TABLE logged3 SET UNLOGGED; -- skip self-referencing foreign key
 ALTER TABLE logged2 SET UNLOGGED;
 ALTER TABLE logged1 SET UNLOGGED;
diff --git a/src/test/regress/expected/insert_conflict.out b/src/test/regress/expected/insert_conflict.out
index 44bc01bf5ab0e16d773573d13adb11a6efbc22f1..f56cbd642dec667b34b179e6cef5c161a8e2371d 100644
--- a/src/test/regress/expected/insert_conflict.out
+++ b/src/test/regress/expected/insert_conflict.out
@@ -226,7 +226,7 @@ insert into insertconflicttest values (1, 'Apple') on conflict do update set fru
 ERROR:  ON CONFLICT DO UPDATE requires inference specification or constraint name
 LINE 1: ...nsert into insertconflicttest values (1, 'Apple') on conflic...
                                                              ^
-HINT:  For example, ON CONFLICT (<column>).
+HINT:  For example, ON CONFLICT (column_name).
 -- inference succeeds:
 insert into insertconflicttest values (1, 'Apple') on conflict (key) do update set fruit = excluded.fruit;
 insert into insertconflicttest values (2, 'Orange') on conflict (key, key, key) do update set fruit = excluded.fruit;
@@ -246,13 +246,13 @@ insert into insertconflicttest values (1, 'Apple') on conflict (keyy) do update
 ERROR:  column "keyy" does not exist
 LINE 1: ...nsertconflicttest values (1, 'Apple') on conflict (keyy) do ...
                                                              ^
-HINT:  Perhaps you meant to reference the column "insertconflicttest"."key".
+HINT:  Perhaps you meant to reference the column "insertconflicttest.key".
 -- Have useful HINT for EXCLUDED.* RTE within UPDATE:
 insert into insertconflicttest values (1, 'Apple') on conflict (key) do update set fruit = excluded.fruitt;
 ERROR:  column excluded.fruitt does not exist
 LINE 1: ... 'Apple') on conflict (key) do update set fruit = excluded.f...
                                                              ^
-HINT:  Perhaps you meant to reference the column "excluded"."fruit".
+HINT:  Perhaps you meant to reference the column "excluded.fruit".
 -- inference fails:
 insert into insertconflicttest values (3, 'Kiwi') on conflict (key, fruit) do update set fruit = excluded.fruit;
 ERROR:  there is no unique or exclusion constraint matching the ON CONFLICT specification
diff --git a/src/test/regress/expected/join.out b/src/test/regress/expected/join.out
index 9d605a29a903b80aedbf6e3a08563fab857b1f33..f8a9f3f264b2e35466b327c65ad62d3c0cbcc8db 100644
--- a/src/test/regress/expected/join.out
+++ b/src/test/regress/expected/join.out
@@ -2299,7 +2299,7 @@ select t1.x from t1 join t3 on (t1.a = t3.x);
 ERROR:  column t1.x does not exist
 LINE 1: select t1.x from t1 join t3 on (t1.a = t3.x);
                ^
-HINT:  Perhaps you meant to reference the column "t3"."x".
+HINT:  Perhaps you meant to reference the column "t3.x".
 --
 -- regression test for 8.1 merge right join bug
 --
@@ -3982,19 +3982,19 @@ select t1.uunique1 from
 ERROR:  column t1.uunique1 does not exist
 LINE 1: select t1.uunique1 from
                ^
-HINT:  Perhaps you meant to reference the column "t1"."unique1".
+HINT:  Perhaps you meant to reference the column "t1.unique1".
 select t2.uunique1 from
   tenk1 t1 join tenk2 t2 on t1.two = t2.two; -- error, prefer "t2" suggestion
 ERROR:  column t2.uunique1 does not exist
 LINE 1: select t2.uunique1 from
                ^
-HINT:  Perhaps you meant to reference the column "t2"."unique1".
+HINT:  Perhaps you meant to reference the column "t2.unique1".
 select uunique1 from
   tenk1 t1 join tenk2 t2 on t1.two = t2.two; -- error, suggest both at once
 ERROR:  column "uunique1" does not exist
 LINE 1: select uunique1 from
                ^
-HINT:  Perhaps you meant to reference the column "t1"."unique1" or the column "t2"."unique1".
+HINT:  Perhaps you meant to reference the column "t1.unique1" or the column "t2.unique1".
 --
 -- Take care to reference the correct RTE
 --
diff --git a/src/test/regress/expected/jsonb.out b/src/test/regress/expected/jsonb.out
index 89c3efd198c130dc35b69519acf75d0e48cb25c8..8d9b5db38de248a6ab9e6658d5ce3cf905f5d07e 100644
--- a/src/test/regress/expected/jsonb.out
+++ b/src/test/regress/expected/jsonb.out
@@ -1373,7 +1373,7 @@ SELECT jsonb_build_object(1,2);
 
 -- keys must be scalar and not null
 SELECT jsonb_build_object(null,2);
-ERROR:  arg 1: key cannot be null
+ERROR:  argument 1: key must not be null
 SELECT jsonb_build_object(r,2) FROM (SELECT 1 AS a, 2 AS b) r;
 ERROR:  key value must be scalar, not array, composite, or json
 SELECT jsonb_build_object(json '{"a":1,"b":2}', 3);
diff --git a/src/test/regress/expected/object_address.out b/src/test/regress/expected/object_address.out
index 034c0b127103c720ae3f418d978e983b0eae3492..963b7ef4dd019ad773a6d2189cd6c2440db1ac03 100644
--- a/src/test/regress/expected/object_address.out
+++ b/src/test/regress/expected/object_address.out
@@ -253,11 +253,11 @@ WARNING:  error for policy,{addr_nsp,zwei},{integer}: relation "addr_nsp" does n
 WARNING:  error for policy,{eins,zwei,drei},{}: schema "eins" does not exist
 WARNING:  error for policy,{eins,zwei,drei},{integer}: schema "eins" does not exist
 WARNING:  error for user mapping,{eins},{}: argument list length must be exactly 1
-WARNING:  error for user mapping,{eins},{integer}: user mapping for user "eins" in server "integer" does not exist
+WARNING:  error for user mapping,{eins},{integer}: user mapping for user "eins" on server "integer" does not exist
 WARNING:  error for user mapping,{addr_nsp,zwei},{}: argument list length must be exactly 1
-WARNING:  error for user mapping,{addr_nsp,zwei},{integer}: user mapping for user "addr_nsp" in server "integer" does not exist
+WARNING:  error for user mapping,{addr_nsp,zwei},{integer}: user mapping for user "addr_nsp" on server "integer" does not exist
 WARNING:  error for user mapping,{eins,zwei,drei},{}: argument list length must be exactly 1
-WARNING:  error for user mapping,{eins,zwei,drei},{integer}: user mapping for user "eins" in server "integer" does not exist
+WARNING:  error for user mapping,{eins,zwei,drei},{integer}: user mapping for user "eins" on server "integer" does not exist
 WARNING:  error for default acl,{eins},{}: argument list length must be exactly 1
 WARNING:  error for default acl,{eins},{integer}: unrecognized default ACL object type i
 WARNING:  error for default acl,{addr_nsp,zwei},{}: argument list length must be exactly 1
diff --git a/src/test/regress/expected/rowsecurity.out b/src/test/regress/expected/rowsecurity.out
index 1d8609f35275bda59d4373f9e1c3294c3b311462..57984e8eb61fc78c09e567b0f6f08b6927df3f35 100644
--- a/src/test/regress/expected/rowsecurity.out
+++ b/src/test/regress/expected/rowsecurity.out
@@ -2577,7 +2577,7 @@ COPY (SELECT * FROM copy_t ORDER BY a ASC) TO STDOUT WITH DELIMITER ',';
 SET SESSION AUTHORIZATION rls_regress_user1;
 SET row_security TO OFF;
 COPY (SELECT * FROM copy_t ORDER BY a ASC) TO STDOUT WITH DELIMITER ','; --fail - insufficient to bypass rls
-ERROR:  insufficient privilege to bypass row security.
+ERROR:  insufficient privilege to bypass row-level security
 SET row_security TO ON;
 COPY (SELECT * FROM copy_t ORDER BY a ASC) TO STDOUT WITH DELIMITER ','; --ok
 0,cfcd208495d565ef66e7dff9f98764da
@@ -2618,7 +2618,7 @@ COPY (SELECT * FROM copy_t ORDER BY a ASC) TO STDOUT WITH DELIMITER ','; --ok
 SET SESSION AUTHORIZATION rls_regress_user2;
 SET row_security TO OFF;
 COPY (SELECT * FROM copy_t ORDER BY a ASC) TO STDOUT WITH DELIMITER ','; --fail - insufficient to bypass rls
-ERROR:  insufficient privilege to bypass row security.
+ERROR:  insufficient privilege to bypass row-level security
 SET row_security TO ON;
 COPY (SELECT * FROM copy_t ORDER BY a ASC) TO STDOUT WITH DELIMITER ','; --fail - permission denied
 ERROR:  permission denied for relation copy_t
@@ -2642,7 +2642,7 @@ COPY copy_rel_to TO STDOUT WITH DELIMITER ',';
 SET SESSION AUTHORIZATION rls_regress_user1;
 SET row_security TO OFF;
 COPY copy_rel_to TO STDOUT WITH DELIMITER ','; --fail - insufficient to bypass rls
-ERROR:  insufficient privilege to bypass row security.
+ERROR:  insufficient privilege to bypass row-level security
 SET row_security TO ON;
 COPY copy_rel_to TO STDOUT WITH DELIMITER ','; --ok
 -- Check COPY TO as user with permissions and BYPASSRLS
@@ -2671,10 +2671,10 @@ COPY copy_t FROM STDIN; --ok
 SET SESSION AUTHORIZATION rls_regress_user1;
 SET row_security TO OFF;
 COPY copy_t FROM STDIN; --fail - insufficient privilege to bypass rls.
-ERROR:  insufficient privilege to bypass row security.
+ERROR:  insufficient privilege to bypass row-level security
 SET row_security TO ON;
 COPY copy_t FROM STDIN; --fail - COPY FROM not supported by RLS.
-ERROR:  COPY FROM not supported with row level security.
+ERROR:  COPY FROM not supported with row-level security.
 HINT:  Use INSERT statements instead.
 -- Check COPY FROM as user with permissions and BYPASSRLS
 SET SESSION AUTHORIZATION rls_regress_exempt_user;