@@ -4788,7 +4788,8 @@ text_reverse(PG_FUNCTION_ARGS)
47884788 if (++(ptr) >= (end_ptr)) \
47894789 ereport(ERROR, \
47904790 (errcode(ERRCODE_INVALID_PARAMETER_VALUE), \
4791- errmsg("unterminated format specifier"))); \
4791+ errmsg("unterminated format() type specifier"), \
4792+ errhint("For a single \"%%\" use \"%%%%\"."))); \
47924793 } while (0)
47934794
47944795/*
@@ -4920,8 +4921,9 @@ text_format(PG_FUNCTION_ARGS)
49204921 if (strchr ("sIL" , * cp ) == NULL )
49214922 ereport (ERROR ,
49224923 (errcode (ERRCODE_INVALID_PARAMETER_VALUE ),
4923- errmsg ("unrecognized conversion type specifier \"%c\"" ,
4924- * cp )));
4924+ errmsg ("unrecognized format() type specifier \"%c\"" ,
4925+ * cp ),
4926+ errhint ("For a single \"%%\" use \"%%%%\"." )));
49254927
49264928 /* If indirect width was specified, get its value */
49274929 if (widthpos >= 0 )
@@ -4932,7 +4934,7 @@ text_format(PG_FUNCTION_ARGS)
49324934 if (arg >= nargs )
49334935 ereport (ERROR ,
49344936 (errcode (ERRCODE_INVALID_PARAMETER_VALUE ),
4935- errmsg ("too few arguments for format" )));
4937+ errmsg ("too few arguments for format() " )));
49364938
49374939 /* Get the value and type of the selected argument */
49384940 if (!funcvariadic )
@@ -5040,8 +5042,9 @@ text_format(PG_FUNCTION_ARGS)
50405042 /* should not get here, because of previous check */
50415043 ereport (ERROR ,
50425044 (errcode (ERRCODE_INVALID_PARAMETER_VALUE ),
5043- errmsg ("unrecognized conversion type specifier \"%c\"" ,
5044- * cp )));
5045+ errmsg ("unrecognized format() type specifier \"%c\"" ,
5046+ * cp ),
5047+ errhint ("For a single \"%%\" use \"%%%%\"." )));
50455048 break ;
50465049 }
50475050 }
0 commit comments