Skip to content

Commit b9a3669

Browse files
committed
Message wordsmithing
1 parent 5c89839 commit b9a3669

File tree

7 files changed

+52
-58
lines changed

7 files changed

+52
-58
lines changed

src/pl/plpgsql/src/gram.y

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/pl/plpgsql/src/gram.y,v 1.120 2009/02/02 20:25:38 tgl Exp $
12+
* $PostgreSQL: pgsql/src/pl/plpgsql/src/gram.y,v 1.121 2009/02/18 11:33:04 petere Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -1043,7 +1043,7 @@ for_control :
10431043
if ($2.scalar && $2.row)
10441044
ereport(ERROR,
10451045
(errcode(ERRCODE_SYNTAX_ERROR),
1046-
errmsg("cursor FOR loop must have just one target variable")));
1046+
errmsg("cursor FOR loop must have only one target variable")));
10471047

10481048
/* create loop's private RECORD variable */
10491049
plpgsql_convert_ident($2.name, &varname, 1);
@@ -1131,7 +1131,7 @@ for_control :
11311131
if ($2.scalar && $2.row)
11321132
ereport(ERROR,
11331133
(errcode(ERRCODE_SYNTAX_ERROR),
1134-
errmsg("integer FOR loop must have just one target variable")));
1134+
errmsg("integer FOR loop must have only one target variable")));
11351135

11361136
/* create loop's private variable */
11371137
plpgsql_convert_ident($2.name, &varname, 1);
@@ -1570,7 +1570,7 @@ stmt_open : K_OPEN lno cursor_variable
15701570
(errcode(ERRCODE_SYNTAX_ERROR),
15711571
errmsg("syntax error at \"%s\"",
15721572
yytext),
1573-
errdetail("Expected FOR to open a reference cursor.")));
1573+
errdetail("Expected \"FOR\", to open a reference cursor.")));
15741574
}
15751575

15761576
tok = yylex();
@@ -1664,7 +1664,7 @@ cursor_variable : T_SCALAR
16641664
plpgsql_error_lineno = plpgsql_scanner_lineno();
16651665
ereport(ERROR,
16661666
(errcode(ERRCODE_DATATYPE_MISMATCH),
1667-
errmsg("\"%s\" must be of type cursor or refcursor",
1667+
errmsg("variable \"%s\" must be of type cursor or refcursor",
16681668
((PLpgSQL_var *) yylval.scalar)->refname)));
16691669
}
16701670
$$ = (PLpgSQL_var *) yylval.scalar;
@@ -2094,7 +2094,7 @@ read_datatype(int tok)
20942094
if (parenlevel != 0)
20952095
yyerror("mismatched parentheses");
20962096
else
2097-
yyerror("incomplete datatype declaration");
2097+
yyerror("incomplete data type declaration");
20982098
}
20992099
/* Possible followers for datatype in a declaration */
21002100
if (tok == K_NOT || tok == K_ASSIGN || tok == K_DEFAULT)
@@ -2119,7 +2119,7 @@ read_datatype(int tok)
21192119
type_name = plpgsql_dstring_get(&ds);
21202120

21212121
if (type_name[0] == '\0')
2122-
yyerror("missing datatype declaration");
2122+
yyerror("missing data type declaration");
21232123

21242124
plpgsql_error_lineno = lno; /* in case of error in parse_datatype */
21252125

@@ -2375,11 +2375,11 @@ make_return_stmt(int lineno)
23752375
break;
23762376

23772377
default:
2378-
yyerror("RETURN must specify a record or row variable in function returning tuple");
2378+
yyerror("RETURN must specify a record or row variable in function returning row");
23792379
break;
23802380
}
23812381
if (yylex() != ';')
2382-
yyerror("RETURN must specify a record or row variable in function returning tuple");
2382+
yyerror("RETURN must specify a record or row variable in function returning row");
23832383
}
23842384
else
23852385
{
@@ -2428,11 +2428,11 @@ make_return_next_stmt(int lineno)
24282428
break;
24292429

24302430
default:
2431-
yyerror("RETURN NEXT must specify a record or row variable in function returning tuple");
2431+
yyerror("RETURN NEXT must specify a record or row variable in function returning row");
24322432
break;
24332433
}
24342434
if (yylex() != ';')
2435-
yyerror("RETURN NEXT must specify a record or row variable in function returning tuple");
2435+
yyerror("RETURN NEXT must specify a record or row variable in function returning row");
24362436
}
24372437
else
24382438
new->expr = plpgsql_read_expression(';', ";");
@@ -2745,7 +2745,7 @@ check_label(const char *yytxt)
27452745

27462746
plpgsql_convert_ident(yytxt, &label_name, 1);
27472747
if (plpgsql_ns_lookup_label(label_name) == NULL)
2748-
yyerror("no such label");
2748+
yyerror("label does not exist");
27492749
return label_name;
27502750
}
27512751

src/pl/plpgsql/src/pl_comp.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.133 2009/01/01 17:24:03 momjian Exp $
11+
* $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.134 2009/02/18 11:33:04 petere Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -415,7 +415,7 @@ do_compile(FunctionCallInfo fcinfo,
415415
argdtype->ttype != PLPGSQL_TTYPE_ROW)
416416
ereport(ERROR,
417417
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
418-
errmsg("plpgsql functions cannot take type %s",
418+
errmsg("PL/pgSQL functions cannot accept type %s",
419419
format_type_be(argtypeid))));
420420

421421
/* Build variable and add to datum list */
@@ -534,7 +534,7 @@ do_compile(FunctionCallInfo fcinfo,
534534
else
535535
ereport(ERROR,
536536
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
537-
errmsg("plpgsql functions cannot return type %s",
537+
errmsg("PL/pgSQL functions cannot return type %s",
538538
format_type_be(rettypeid))));
539539
}
540540

@@ -576,7 +576,7 @@ do_compile(FunctionCallInfo fcinfo,
576576
ereport(ERROR,
577577
(errcode(ERRCODE_INVALID_FUNCTION_DEFINITION),
578578
errmsg("trigger functions cannot have declared arguments"),
579-
errhint("You probably want to use TG_NARGS and TG_ARGV instead.")));
579+
errhint("The arguments of the trigger can be accessed through TG_NARGS and TG_ARGV instead.")));
580580

581581
/* Add the record for referencing NEW */
582582
rec = plpgsql_build_record("new", 0, true);
@@ -766,7 +766,7 @@ plpgsql_compile_error_callback(void *arg)
766766
}
767767

768768
if (plpgsql_error_funcname)
769-
errcontext("compile of PL/pgSQL function \"%s\" near line %d",
769+
errcontext("compilation of PL/pgSQL function \"%s\" near line %d",
770770
plpgsql_error_funcname, plpgsql_error_lineno);
771771
}
772772

src/pl/plpgsql/src/pl_exec.c

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.233 2009/02/17 12:51:59 petere Exp $
11+
* $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.234 2009/02/18 11:33:04 petere Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -706,7 +706,7 @@ plpgsql_exec_trigger(PLpgSQL_function *func,
706706
{
707707
validate_tupdesc_compat(trigdata->tg_relation->rd_att,
708708
estate.rettupdesc,
709-
"returned tuple structure does not match table of trigger event");
709+
"returned row structure does not match the structure of the triggering table");
710710
/* Copy tuple to upper executor memory */
711711
rettup = SPI_copytuple((HeapTuple) DatumGetPointer(estate.retval));
712712
}
@@ -765,24 +765,18 @@ plpgsql_exec_error_callback(void *arg)
765765
*/
766766
if (estate->err_stmt != NULL)
767767
{
768-
/*
769-
* translator: last %s is a phrase such as "during statement block
770-
* local variable initialization"
771-
*/
768+
/* translator: last %s is a phrase such as "during statement block local variable initialization" */
772769
errcontext("PL/pgSQL function \"%s\" line %d %s",
773770
estate->err_func->fn_name,
774771
estate->err_stmt->lineno,
775-
gettext(estate->err_text));
772+
_(estate->err_text));
776773
}
777774
else
778775
{
779-
/*
780-
* translator: last %s is a phrase such as "while storing call
781-
* arguments into local variables"
782-
*/
776+
/* translator: last %s is a phrase such as "while storing call arguments into local variables" */
783777
errcontext("PL/pgSQL function \"%s\" %s",
784778
estate->err_func->fn_name,
785-
gettext(estate->err_text));
779+
_(estate->err_text));
786780
}
787781
}
788782
else if (estate->err_stmt != NULL)
@@ -1677,7 +1671,7 @@ exec_stmt_fori(PLpgSQL_execstate *estate, PLpgSQL_stmt_fori *stmt)
16771671
if (isnull)
16781672
ereport(ERROR,
16791673
(errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
1680-
errmsg("lower bound of FOR loop cannot be NULL")));
1674+
errmsg("lower bound of FOR loop cannot be null")));
16811675
loop_value = DatumGetInt32(value);
16821676
exec_eval_cleanup(estate);
16831677

@@ -1692,7 +1686,7 @@ exec_stmt_fori(PLpgSQL_execstate *estate, PLpgSQL_stmt_fori *stmt)
16921686
if (isnull)
16931687
ereport(ERROR,
16941688
(errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
1695-
errmsg("upper bound of FOR loop cannot be NULL")));
1689+
errmsg("upper bound of FOR loop cannot be null")));
16961690
end_value = DatumGetInt32(value);
16971691
exec_eval_cleanup(estate);
16981692

@@ -1709,7 +1703,7 @@ exec_stmt_fori(PLpgSQL_execstate *estate, PLpgSQL_stmt_fori *stmt)
17091703
if (isnull)
17101704
ereport(ERROR,
17111705
(errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
1712-
errmsg("BY value of FOR loop cannot be NULL")));
1706+
errmsg("BY value of FOR loop cannot be null")));
17131707
step_value = DatumGetInt32(value);
17141708
exec_eval_cleanup(estate);
17151709
if (step_value <= 0)
@@ -2470,7 +2464,7 @@ exec_stmt_raise(PLpgSQL_execstate *estate, PLpgSQL_stmt_raise *stmt)
24702464
if (optionisnull)
24712465
ereport(ERROR,
24722466
(errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
2473-
errmsg("RAISE statement option cannot be NULL")));
2467+
errmsg("RAISE statement option cannot be null")));
24742468

24752469
extval = convert_value_to_string(optionvalue, optiontypeid);
24762470

@@ -2916,7 +2910,7 @@ exec_stmt_dynexecute(PLpgSQL_execstate *estate,
29162910
if (isnull)
29172911
ereport(ERROR,
29182912
(errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
2919-
errmsg("cannot EXECUTE a null querystring")));
2913+
errmsg("query string argument of EXECUTE is null")));
29202914

29212915
/* Get the C-String representation */
29222916
querystr = convert_value_to_string(query, restype);
@@ -2981,7 +2975,7 @@ exec_stmt_dynexecute(PLpgSQL_execstate *estate,
29812975
if (*ptr == 'S' || *ptr == 's')
29822976
ereport(ERROR,
29832977
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
2984-
errmsg("EXECUTE of SELECT ... INTO is not implemented yet")));
2978+
errmsg("EXECUTE of SELECT ... INTO is not implemented")));
29852979
break;
29862980
}
29872981

@@ -3166,7 +3160,7 @@ exec_stmt_open(PLpgSQL_execstate *estate, PLpgSQL_stmt_open *stmt)
31663160
if (isnull)
31673161
ereport(ERROR,
31683162
(errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
3169-
errmsg("cannot EXECUTE a null querystring")));
3163+
errmsg("query string argument of EXECUTE is null")));
31703164

31713165
/* Get the C-String representation */
31723166
querystr = convert_value_to_string(queryD, restype);
@@ -3300,7 +3294,7 @@ exec_stmt_fetch(PLpgSQL_execstate *estate, PLpgSQL_stmt_fetch *stmt)
33003294
if (curvar->isnull)
33013295
ereport(ERROR,
33023296
(errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
3303-
errmsg("cursor variable \"%s\" is NULL", curvar->refname)));
3297+
errmsg("cursor variable \"%s\" is null", curvar->refname)));
33043298
curname = TextDatumGetCString(curvar->value);
33053299

33063300
portal = SPI_cursor_find(curname);
@@ -3321,7 +3315,7 @@ exec_stmt_fetch(PLpgSQL_execstate *estate, PLpgSQL_stmt_fetch *stmt)
33213315
if (isnull)
33223316
ereport(ERROR,
33233317
(errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
3324-
errmsg("relative or absolute cursor position is NULL")));
3318+
errmsg("relative or absolute cursor position is null")));
33253319

33263320
exec_eval_cleanup(estate);
33273321
}
@@ -3396,7 +3390,7 @@ exec_stmt_close(PLpgSQL_execstate *estate, PLpgSQL_stmt_close *stmt)
33963390
if (curvar->isnull)
33973391
ereport(ERROR,
33983392
(errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
3399-
errmsg("cursor variable \"%s\" is NULL", curvar->refname)));
3393+
errmsg("cursor variable \"%s\" is null", curvar->refname)));
34003394
curname = TextDatumGetCString(curvar->value);
34013395

34023396
portal = SPI_cursor_find(curname);
@@ -3463,7 +3457,7 @@ exec_assign_value(PLpgSQL_execstate *estate,
34633457
if (*isNull && var->notnull)
34643458
ereport(ERROR,
34653459
(errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
3466-
errmsg("NULL cannot be assigned to variable \"%s\" declared NOT NULL",
3460+
errmsg("null value cannot be assigned to variable \"%s\" declared NOT NULL",
34673461
var->refname)));
34683462

34693463
/*
@@ -3720,8 +3714,8 @@ exec_assign_value(PLpgSQL_execstate *estate,
37203714
if (nsubscripts >= MAXDIM)
37213715
ereport(ERROR,
37223716
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
3723-
errmsg("number of array dimensions exceeds the maximum allowed, %d",
3724-
MAXDIM)));
3717+
errmsg("number of array dimensions (%d) exceeds the maximum allowed (%d)",
3718+
nsubscripts, MAXDIM)));
37253719
subscripts[nsubscripts++] = arrayelem->subscript;
37263720
target = estate->datums[arrayelem->arrayparentno];
37273721
} while (target->dtype == PLPGSQL_DTYPE_ARRAYELEM);
@@ -3757,7 +3751,7 @@ exec_assign_value(PLpgSQL_execstate *estate,
37573751
if (subisnull)
37583752
ereport(ERROR,
37593753
(errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
3760-
errmsg("array subscript in assignment must not be NULL")));
3754+
errmsg("array subscript in assignment must not be null")));
37613755
}
37623756

37633757
/* Coerce source value to match array element type. */
@@ -5129,7 +5123,7 @@ static void
51295123
validate_tupdesc_compat(TupleDesc expected, TupleDesc returned, const char *msg)
51305124
{
51315125
int i;
5132-
const char *dropped_column_type = gettext_noop("n/a (dropped column)");
5126+
const char *dropped_column_type = gettext_noop("N/A (dropped column)");
51335127

51345128
if (!expected || !returned)
51355129
ereport(ERROR,
@@ -5402,7 +5396,7 @@ exec_dynquery_with_params(PLpgSQL_execstate *estate, PLpgSQL_expr *dynquery,
54025396
if (isnull)
54035397
ereport(ERROR,
54045398
(errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
5405-
errmsg("cannot EXECUTE a null querystring")));
5399+
errmsg("query string argument of EXECUTE is null")));
54065400

54075401
/* Get the C-String representation */
54085402
querystr = convert_value_to_string(query, restype);

src/pl/plpgsql/src/pl_funcs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_funcs.c,v 1.75 2009/01/01 17:24:04 momjian Exp $
11+
* $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_funcs.c,v 1.76 2009/02/18 11:33:04 petere Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -356,7 +356,7 @@ plpgsql_ns_rename(char *oldname, char *newname)
356356

357357
ereport(ERROR,
358358
(errcode(ERRCODE_UNDEFINED_OBJECT),
359-
errmsg("there is no variable \"%s\" in the current block",
359+
errmsg("variable \"%s\" does not exist in the current block",
360360
oldname)));
361361
}
362362

@@ -412,7 +412,7 @@ plpgsql_convert_ident(const char *s, char **output, int numidents)
412412
if (*s != '"') /* should not happen if lexer checked */
413413
ereport(ERROR,
414414
(errcode(ERRCODE_SYNTAX_ERROR),
415-
errmsg("unterminated \" in name: %s", sstart)));
415+
errmsg("unterminated \" in identifier: %s", sstart)));
416416
s++;
417417
*cp = '\0';
418418
/* Truncate to NAMEDATALEN */

src/pl/plpgsql/src/pl_handler.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_handler.c,v 1.43 2009/01/01 17:24:04 momjian Exp $
11+
* $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_handler.c,v 1.44 2009/02/18 11:33:04 petere Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -159,7 +159,7 @@ plpgsql_validator(PG_FUNCTION_ARGS)
159159
!IsPolymorphicType(proc->prorettype))
160160
ereport(ERROR,
161161
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
162-
errmsg("plpgsql functions cannot return type %s",
162+
errmsg("PL/pgSQL functions cannot return type %s",
163163
format_type_be(proc->prorettype))));
164164
}
165165

@@ -174,7 +174,7 @@ plpgsql_validator(PG_FUNCTION_ARGS)
174174
if (!IsPolymorphicType(argtypes[i]))
175175
ereport(ERROR,
176176
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
177-
errmsg("plpgsql functions cannot take type %s",
177+
errmsg("PL/pgSQL functions cannot accept type %s",
178178
format_type_be(argtypes[i]))));
179179
}
180180
}

0 commit comments

Comments
 (0)