8
8
*
9
9
*
10
10
* 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 $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
@@ -706,7 +706,7 @@ plpgsql_exec_trigger(PLpgSQL_function *func,
706
706
{
707
707
validate_tupdesc_compat (trigdata -> tg_relation -> rd_att ,
708
708
estate .rettupdesc ,
709
- "returnedtuple structure does not matchtable oftrigger event " );
709
+ "returnedrow structure does not matchthe structure ofthe triggering table " );
710
710
/* Copy tuple to upper executor memory */
711
711
rettup = SPI_copytuple ((HeapTuple )DatumGetPointer (estate .retval ));
712
712
}
@@ -765,24 +765,18 @@ plpgsql_exec_error_callback(void *arg)
765
765
*/
766
766
if (estate -> err_stmt != NULL )
767
767
{
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" */
772
769
errcontext ("PL/pgSQL function \"%s\" line %d %s" ,
773
770
estate -> err_func -> fn_name ,
774
771
estate -> err_stmt -> lineno ,
775
- gettext (estate -> err_text ));
772
+ _ (estate -> err_text ));
776
773
}
777
774
else
778
775
{
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" */
783
777
errcontext ("PL/pgSQL function \"%s\" %s" ,
784
778
estate -> err_func -> fn_name ,
785
- gettext (estate -> err_text ));
779
+ _ (estate -> err_text ));
786
780
}
787
781
}
788
782
else if (estate -> err_stmt != NULL )
@@ -1677,7 +1671,7 @@ exec_stmt_fori(PLpgSQL_execstate *estate, PLpgSQL_stmt_fori *stmt)
1677
1671
if (isnull )
1678
1672
ereport (ERROR ,
1679
1673
(errcode (ERRCODE_NULL_VALUE_NOT_ALLOWED ),
1680
- errmsg ("lower bound of FOR loop cannot beNULL " )));
1674
+ errmsg ("lower bound of FOR loop cannot benull " )));
1681
1675
loop_value = DatumGetInt32 (value );
1682
1676
exec_eval_cleanup (estate );
1683
1677
@@ -1692,7 +1686,7 @@ exec_stmt_fori(PLpgSQL_execstate *estate, PLpgSQL_stmt_fori *stmt)
1692
1686
if (isnull )
1693
1687
ereport (ERROR ,
1694
1688
(errcode (ERRCODE_NULL_VALUE_NOT_ALLOWED ),
1695
- errmsg ("upper bound of FOR loop cannot beNULL " )));
1689
+ errmsg ("upper bound of FOR loop cannot benull " )));
1696
1690
end_value = DatumGetInt32 (value );
1697
1691
exec_eval_cleanup (estate );
1698
1692
@@ -1709,7 +1703,7 @@ exec_stmt_fori(PLpgSQL_execstate *estate, PLpgSQL_stmt_fori *stmt)
1709
1703
if (isnull )
1710
1704
ereport (ERROR ,
1711
1705
(errcode (ERRCODE_NULL_VALUE_NOT_ALLOWED ),
1712
- errmsg ("BY value of FOR loop cannot beNULL " )));
1706
+ errmsg ("BY value of FOR loop cannot benull " )));
1713
1707
step_value = DatumGetInt32 (value );
1714
1708
exec_eval_cleanup (estate );
1715
1709
if (step_value <=0 )
@@ -2470,7 +2464,7 @@ exec_stmt_raise(PLpgSQL_execstate *estate, PLpgSQL_stmt_raise *stmt)
2470
2464
if (optionisnull )
2471
2465
ereport (ERROR ,
2472
2466
(errcode (ERRCODE_NULL_VALUE_NOT_ALLOWED ),
2473
- errmsg ("RAISE statement option cannot beNULL " )));
2467
+ errmsg ("RAISE statement option cannot benull " )));
2474
2468
2475
2469
extval = convert_value_to_string (optionvalue ,optiontypeid );
2476
2470
@@ -2916,7 +2910,7 @@ exec_stmt_dynexecute(PLpgSQL_execstate *estate,
2916
2910
if (isnull )
2917
2911
ereport (ERROR ,
2918
2912
(errcode (ERRCODE_NULL_VALUE_NOT_ALLOWED ),
2919
- errmsg ("cannot EXECUTEa null querystring " )));
2913
+ errmsg ("query string argument of EXECUTEis null" )));
2920
2914
2921
2915
/* Get the C-String representation */
2922
2916
querystr = convert_value_to_string (query ,restype );
@@ -2981,7 +2975,7 @@ exec_stmt_dynexecute(PLpgSQL_execstate *estate,
2981
2975
if (* ptr == 'S' || * ptr == 's' )
2982
2976
ereport (ERROR ,
2983
2977
(errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
2984
- errmsg ("EXECUTE of SELECT ... INTO is not implemented yet " )));
2978
+ errmsg ("EXECUTE of SELECT ... INTO is not implemented" )));
2985
2979
break ;
2986
2980
}
2987
2981
@@ -3166,7 +3160,7 @@ exec_stmt_open(PLpgSQL_execstate *estate, PLpgSQL_stmt_open *stmt)
3166
3160
if (isnull )
3167
3161
ereport (ERROR ,
3168
3162
(errcode (ERRCODE_NULL_VALUE_NOT_ALLOWED ),
3169
- errmsg ("cannot EXECUTEa null querystring " )));
3163
+ errmsg ("query string argument of EXECUTEis null" )));
3170
3164
3171
3165
/* Get the C-String representation */
3172
3166
querystr = convert_value_to_string (queryD ,restype );
@@ -3300,7 +3294,7 @@ exec_stmt_fetch(PLpgSQL_execstate *estate, PLpgSQL_stmt_fetch *stmt)
3300
3294
if (curvar -> isnull )
3301
3295
ereport (ERROR ,
3302
3296
(errcode (ERRCODE_NULL_VALUE_NOT_ALLOWED ),
3303
- errmsg ("cursor variable \"%s\" isNULL " ,curvar -> refname )));
3297
+ errmsg ("cursor variable \"%s\" isnull " ,curvar -> refname )));
3304
3298
curname = TextDatumGetCString (curvar -> value );
3305
3299
3306
3300
portal = SPI_cursor_find (curname );
@@ -3321,7 +3315,7 @@ exec_stmt_fetch(PLpgSQL_execstate *estate, PLpgSQL_stmt_fetch *stmt)
3321
3315
if (isnull )
3322
3316
ereport (ERROR ,
3323
3317
(errcode (ERRCODE_NULL_VALUE_NOT_ALLOWED ),
3324
- errmsg ("relative or absolute cursor position isNULL " )));
3318
+ errmsg ("relative or absolute cursor position isnull " )));
3325
3319
3326
3320
exec_eval_cleanup (estate );
3327
3321
}
@@ -3396,7 +3390,7 @@ exec_stmt_close(PLpgSQL_execstate *estate, PLpgSQL_stmt_close *stmt)
3396
3390
if (curvar -> isnull )
3397
3391
ereport (ERROR ,
3398
3392
(errcode (ERRCODE_NULL_VALUE_NOT_ALLOWED ),
3399
- errmsg ("cursor variable \"%s\" isNULL " ,curvar -> refname )));
3393
+ errmsg ("cursor variable \"%s\" isnull " ,curvar -> refname )));
3400
3394
curname = TextDatumGetCString (curvar -> value );
3401
3395
3402
3396
portal = SPI_cursor_find (curname );
@@ -3463,7 +3457,7 @@ exec_assign_value(PLpgSQL_execstate *estate,
3463
3457
if (* isNull && var -> notnull )
3464
3458
ereport (ERROR ,
3465
3459
(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" ,
3467
3461
var -> refname )));
3468
3462
3469
3463
/*
@@ -3720,8 +3714,8 @@ exec_assign_value(PLpgSQL_execstate *estate,
3720
3714
if (nsubscripts >=MAXDIM )
3721
3715
ereport (ERROR ,
3722
3716
(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 )));
3725
3719
subscripts [nsubscripts ++ ]= arrayelem -> subscript ;
3726
3720
target = estate -> datums [arrayelem -> arrayparentno ];
3727
3721
}while (target -> dtype == PLPGSQL_DTYPE_ARRAYELEM );
@@ -3757,7 +3751,7 @@ exec_assign_value(PLpgSQL_execstate *estate,
3757
3751
if (subisnull )
3758
3752
ereport (ERROR ,
3759
3753
(errcode (ERRCODE_NULL_VALUE_NOT_ALLOWED ),
3760
- errmsg ("array subscript in assignment must not beNULL " )));
3754
+ errmsg ("array subscript in assignment must not benull " )));
3761
3755
}
3762
3756
3763
3757
/* Coerce source value to match array element type. */
@@ -5129,7 +5123,7 @@ static void
5129
5123
validate_tupdesc_compat (TupleDesc expected ,TupleDesc returned ,const char * msg )
5130
5124
{
5131
5125
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)" );
5133
5127
5134
5128
if (!expected || !returned )
5135
5129
ereport (ERROR ,
@@ -5402,7 +5396,7 @@ exec_dynquery_with_params(PLpgSQL_execstate *estate, PLpgSQL_expr *dynquery,
5402
5396
if (isnull )
5403
5397
ereport (ERROR ,
5404
5398
(errcode (ERRCODE_NULL_VALUE_NOT_ALLOWED ),
5405
- errmsg ("cannot EXECUTEa null querystring " )));
5399
+ errmsg ("query string argument of EXECUTEis null" )));
5406
5400
5407
5401
/* Get the C-String representation */
5408
5402
querystr = convert_value_to_string (query ,restype );