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{
707707validate_tupdesc_compat (trigdata -> tg_relation -> rd_att ,
708708estate .rettupdesc ,
709- "returnedtuple structure does not matchtable oftrigger event " );
709+ "returnedrow structure does not matchthe structure ofthe triggering table " );
710710/* Copy tuple to upper executor memory */
711711rettup = SPI_copytuple ((HeapTuple )DatumGetPointer (estate .retval ));
712712}
@@ -765,24 +765,18 @@ plpgsql_exec_error_callback(void *arg)
765765 */
766766if (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" */
772769errcontext ("PL/pgSQL function \"%s\" line %d %s" ,
773770estate -> err_func -> fn_name ,
774771estate -> err_stmt -> lineno ,
775- gettext (estate -> err_text ));
772+ _ (estate -> err_text ));
776773}
777774else
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" */
783777errcontext ("PL/pgSQL function \"%s\" %s" ,
784778estate -> err_func -> fn_name ,
785- gettext (estate -> err_text ));
779+ _ (estate -> err_text ));
786780}
787781}
788782else if (estate -> err_stmt != NULL )
@@ -1677,7 +1671,7 @@ exec_stmt_fori(PLpgSQL_execstate *estate, PLpgSQL_stmt_fori *stmt)
16771671if (isnull )
16781672ereport (ERROR ,
16791673(errcode (ERRCODE_NULL_VALUE_NOT_ALLOWED ),
1680- errmsg ("lower bound of FOR loop cannot beNULL " )));
1674+ errmsg ("lower bound of FOR loop cannot benull " )));
16811675loop_value = DatumGetInt32 (value );
16821676exec_eval_cleanup (estate );
16831677
@@ -1692,7 +1686,7 @@ exec_stmt_fori(PLpgSQL_execstate *estate, PLpgSQL_stmt_fori *stmt)
16921686if (isnull )
16931687ereport (ERROR ,
16941688(errcode (ERRCODE_NULL_VALUE_NOT_ALLOWED ),
1695- errmsg ("upper bound of FOR loop cannot beNULL " )));
1689+ errmsg ("upper bound of FOR loop cannot benull " )));
16961690end_value = DatumGetInt32 (value );
16971691exec_eval_cleanup (estate );
16981692
@@ -1709,7 +1703,7 @@ exec_stmt_fori(PLpgSQL_execstate *estate, PLpgSQL_stmt_fori *stmt)
17091703if (isnull )
17101704ereport (ERROR ,
17111705(errcode (ERRCODE_NULL_VALUE_NOT_ALLOWED ),
1712- errmsg ("BY value of FOR loop cannot beNULL " )));
1706+ errmsg ("BY value of FOR loop cannot benull " )));
17131707step_value = DatumGetInt32 (value );
17141708exec_eval_cleanup (estate );
17151709if (step_value <=0 )
@@ -2470,7 +2464,7 @@ exec_stmt_raise(PLpgSQL_execstate *estate, PLpgSQL_stmt_raise *stmt)
24702464if (optionisnull )
24712465ereport (ERROR ,
24722466(errcode (ERRCODE_NULL_VALUE_NOT_ALLOWED ),
2473- errmsg ("RAISE statement option cannot beNULL " )));
2467+ errmsg ("RAISE statement option cannot benull " )));
24742468
24752469extval = convert_value_to_string (optionvalue ,optiontypeid );
24762470
@@ -2916,7 +2910,7 @@ exec_stmt_dynexecute(PLpgSQL_execstate *estate,
29162910if (isnull )
29172911ereport (ERROR ,
29182912(errcode (ERRCODE_NULL_VALUE_NOT_ALLOWED ),
2919- errmsg ("cannot EXECUTEa null querystring " )));
2913+ errmsg ("query string argument of EXECUTEis null" )));
29202914
29212915/* Get the C-String representation */
29222916querystr = convert_value_to_string (query ,restype );
@@ -2981,7 +2975,7 @@ exec_stmt_dynexecute(PLpgSQL_execstate *estate,
29812975if (* ptr == 'S' || * ptr == 's' )
29822976ereport (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" )));
29852979break ;
29862980}
29872981
@@ -3166,7 +3160,7 @@ exec_stmt_open(PLpgSQL_execstate *estate, PLpgSQL_stmt_open *stmt)
31663160if (isnull )
31673161ereport (ERROR ,
31683162(errcode (ERRCODE_NULL_VALUE_NOT_ALLOWED ),
3169- errmsg ("cannot EXECUTEa null querystring " )));
3163+ errmsg ("query string argument of EXECUTEis null" )));
31703164
31713165/* Get the C-String representation */
31723166querystr = convert_value_to_string (queryD ,restype );
@@ -3300,7 +3294,7 @@ exec_stmt_fetch(PLpgSQL_execstate *estate, PLpgSQL_stmt_fetch *stmt)
33003294if (curvar -> isnull )
33013295ereport (ERROR ,
33023296(errcode (ERRCODE_NULL_VALUE_NOT_ALLOWED ),
3303- errmsg ("cursor variable \"%s\" isNULL " ,curvar -> refname )));
3297+ errmsg ("cursor variable \"%s\" isnull " ,curvar -> refname )));
33043298curname = TextDatumGetCString (curvar -> value );
33053299
33063300portal = SPI_cursor_find (curname );
@@ -3321,7 +3315,7 @@ exec_stmt_fetch(PLpgSQL_execstate *estate, PLpgSQL_stmt_fetch *stmt)
33213315if (isnull )
33223316ereport (ERROR ,
33233317(errcode (ERRCODE_NULL_VALUE_NOT_ALLOWED ),
3324- errmsg ("relative or absolute cursor position isNULL " )));
3318+ errmsg ("relative or absolute cursor position isnull " )));
33253319
33263320exec_eval_cleanup (estate );
33273321}
@@ -3396,7 +3390,7 @@ exec_stmt_close(PLpgSQL_execstate *estate, PLpgSQL_stmt_close *stmt)
33963390if (curvar -> isnull )
33973391ereport (ERROR ,
33983392(errcode (ERRCODE_NULL_VALUE_NOT_ALLOWED ),
3399- errmsg ("cursor variable \"%s\" isNULL " ,curvar -> refname )));
3393+ errmsg ("cursor variable \"%s\" isnull " ,curvar -> refname )));
34003394curname = TextDatumGetCString (curvar -> value );
34013395
34023396portal = SPI_cursor_find (curname );
@@ -3463,7 +3457,7 @@ exec_assign_value(PLpgSQL_execstate *estate,
34633457if (* isNull && var -> notnull )
34643458ereport (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" ,
34673461var -> refname )));
34683462
34693463/*
@@ -3720,8 +3714,8 @@ exec_assign_value(PLpgSQL_execstate *estate,
37203714if (nsubscripts >=MAXDIM )
37213715ereport (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 )));
37253719subscripts [nsubscripts ++ ]= arrayelem -> subscript ;
37263720target = estate -> datums [arrayelem -> arrayparentno ];
37273721}while (target -> dtype == PLPGSQL_DTYPE_ARRAYELEM );
@@ -3757,7 +3751,7 @@ exec_assign_value(PLpgSQL_execstate *estate,
37573751if (subisnull )
37583752ereport (ERROR ,
37593753(errcode (ERRCODE_NULL_VALUE_NOT_ALLOWED ),
3760- errmsg ("array subscript in assignment must not beNULL " )));
3754+ errmsg ("array subscript in assignment must not benull " )));
37613755}
37623756
37633757/* Coerce source value to match array element type. */
@@ -5129,7 +5123,7 @@ static void
51295123validate_tupdesc_compat (TupleDesc expected ,TupleDesc returned ,const char * msg )
51305124{
51315125int 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
51345128if (!expected || !returned )
51355129ereport (ERROR ,
@@ -5402,7 +5396,7 @@ exec_dynquery_with_params(PLpgSQL_execstate *estate, PLpgSQL_expr *dynquery,
54025396if (isnull )
54035397ereport (ERROR ,
54045398(errcode (ERRCODE_NULL_VALUE_NOT_ALLOWED ),
5405- errmsg ("cannot EXECUTEa null querystring " )));
5399+ errmsg ("query string argument of EXECUTEis null" )));
54065400
54075401/* Get the C-String representation */
54085402querystr = convert_value_to_string (query ,restype );