diff --git a/src/backend/utils/adt/jsonpath_exec.c b/src/backend/utils/adt/jsonpath_exec.c
index c10926a8a2..4a2a995325 100644
--- a/src/backend/utils/adt/jsonpath_exec.c
+++ b/src/backend/utils/adt/jsonpath_exec.c
@@ -2368,8 +2368,8 @@ executeDateTimeMethod(JsonPathExecContext *cxt, JsonPathItem *jsp,
 			if (jsp->type == jpiDatetime)
 				RETURN_ERROR(ereport(ERROR,
 									 (errcode(ERRCODE_INVALID_ARGUMENT_FOR_SQL_JSON_DATETIME_FUNCTION),
-									  errmsg("datetime format is not recognized: \"%s\"",
-											 text_to_cstring(datetime)),
+									  errmsg("%s format is not recognized: \"%s\"",
+											 "datetime", text_to_cstring(datetime)),
 									  errhint("Use a datetime template argument to specify the input data format."))));
 			else
 				RETURN_ERROR(ereport(ERROR,
@@ -2401,8 +2401,8 @@ executeDateTimeMethod(JsonPathExecContext *cxt, JsonPathItem *jsp,
 					case TIMETZOID:
 						RETURN_ERROR(ereport(ERROR,
 											 (errcode(ERRCODE_INVALID_ARGUMENT_FOR_SQL_JSON_DATETIME_FUNCTION),
-											  errmsg("date format is not recognized: \"%s\"",
-													 text_to_cstring(datetime)))));
+											  errmsg("%s format is not recognized: \"%s\"",
+													 "date", text_to_cstring(datetime)))));
 						break;
 					case TIMESTAMPOID:
 						value = DirectFunctionCall1(timestamp_date,
@@ -2427,8 +2427,8 @@ executeDateTimeMethod(JsonPathExecContext *cxt, JsonPathItem *jsp,
 					case DATEOID:
 						RETURN_ERROR(ereport(ERROR,
 											 (errcode(ERRCODE_INVALID_ARGUMENT_FOR_SQL_JSON_DATETIME_FUNCTION),
-											  errmsg("time format is not recognized: \"%s\"",
-													 text_to_cstring(datetime)))));
+											  errmsg("%s format is not recognized: \"%s\"",
+													 "time", text_to_cstring(datetime)))));
 						break;
 					case TIMEOID:	/* Nothing to do for TIME */
 						break;
@@ -2476,8 +2476,8 @@ executeDateTimeMethod(JsonPathExecContext *cxt, JsonPathItem *jsp,
 					case TIMESTAMPOID:
 						RETURN_ERROR(ereport(ERROR,
 											 (errcode(ERRCODE_INVALID_ARGUMENT_FOR_SQL_JSON_DATETIME_FUNCTION),
-											  errmsg("time_tz format is not recognized: \"%s\"",
-													 text_to_cstring(datetime)))));
+											  errmsg("%s format is not recognized: \"%s\"",
+													 "time_tz", text_to_cstring(datetime)))));
 						break;
 					case TIMEOID:
 						value = DirectFunctionCall1(time_timetz,
@@ -2525,8 +2525,8 @@ executeDateTimeMethod(JsonPathExecContext *cxt, JsonPathItem *jsp,
 					case TIMETZOID:
 						RETURN_ERROR(ereport(ERROR,
 											 (errcode(ERRCODE_INVALID_ARGUMENT_FOR_SQL_JSON_DATETIME_FUNCTION),
-											  errmsg("timestamp format is not recognized: \"%s\"",
-													 text_to_cstring(datetime)))));
+											  errmsg("%s format is not recognized: \"%s\"",
+													 "timestamp", text_to_cstring(datetime)))));
 						break;
 					case TIMESTAMPOID:	/* Nothing to do for TIMESTAMP */
 						break;
@@ -2577,8 +2577,8 @@ executeDateTimeMethod(JsonPathExecContext *cxt, JsonPathItem *jsp,
 					case TIMETZOID:
 						RETURN_ERROR(ereport(ERROR,
 											 (errcode(ERRCODE_INVALID_ARGUMENT_FOR_SQL_JSON_DATETIME_FUNCTION),
-											  errmsg("timestamp_tz format is not recognized: \"%s\"",
-													 text_to_cstring(datetime)))));
+											  errmsg("%s format is not recognized: \"%s\"",
+													 "timestamp_tz", text_to_cstring(datetime)))));
 						break;
 					case TIMESTAMPOID:
 						value = DirectFunctionCall1(timestamp_timestamptz,
