Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 80e26ca

Browse files
committed
Wordsmithing for PL/Perl messages
1 parent 6becfa2 commit 80e26ca

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

src/pl/plperl/expected/plperl.out

+8-8
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ CREATE OR REPLACE FUNCTION perl_set() RETURNS SETOF testrowperl AS $$
121121
];
122122
$$ LANGUAGE plperl;
123123
SELECT perl_set();
124-
ERROR: setof-composite-returning Perl function must call return_next with reference to hash
124+
ERROR: SETOF-composite-returning PL/Perl function must call return_next with reference to hash
125125
SELECT * FROM perl_set();
126-
ERROR: setof-composite-returning Perl function must call return_next with reference to hash
126+
ERROR: SETOF-composite-returning PL/Perl function must call return_next with reference to hash
127127
CREATE OR REPLACE FUNCTION perl_set() RETURNS SETOF testrowperl AS $$
128128
return [
129129
{ f1 => 1, f2 => 'Hello', f3 => 'World' },
@@ -209,7 +209,7 @@ ERROR: a column definition list is required for functions returning "record"
209209
LINE 1: SELECT * FROM perl_record_set();
210210
^
211211
SELECT * FROM perl_record_set() AS (f1 integer, f2 text, f3 text);
212-
ERROR: setof-composite-returning Perl function must call return_next with reference to hash
212+
ERROR: SETOF-composite-returning PL/Perl function must call return_next with reference to hash
213213
CREATE OR REPLACE FUNCTION perl_record_set() RETURNS SETOF record AS $$
214214
return [
215215
{ f1 => 1, f2 => 'Hello', f3 => 'World' },
@@ -312,33 +312,33 @@ CREATE OR REPLACE FUNCTION foo_bad() RETURNS footype AS $$
312312
return 42;
313313
$$ LANGUAGE plperl;
314314
SELECT * FROM foo_bad();
315-
ERROR: composite-returning Perl function must return reference to hash
315+
ERROR: composite-returning PL/Perl function must return reference to hash
316316
CREATE OR REPLACE FUNCTION foo_bad() RETURNS footype AS $$
317317
return [
318318
[1, 2],
319319
[3, 4]
320320
];
321321
$$ LANGUAGE plperl;
322322
SELECT * FROM foo_bad();
323-
ERROR: composite-returning Perl function must return reference to hash
323+
ERROR: composite-returning PL/Perl function must return reference to hash
324324
CREATE OR REPLACE FUNCTION foo_set_bad() RETURNS SETOF footype AS $$
325325
return 42;
326326
$$ LANGUAGE plperl;
327327
SELECT * FROM foo_set_bad();
328-
ERROR: set-returning Perl function must return reference to array or use return_next
328+
ERROR: set-returning PL/Perl function must return reference to array or use return_next
329329
CREATE OR REPLACE FUNCTION foo_set_bad() RETURNS SETOF footype AS $$
330330
return {y => 3, z => 4};
331331
$$ LANGUAGE plperl;
332332
SELECT * FROM foo_set_bad();
333-
ERROR: set-returning Perl function must return reference to array or use return_next
333+
ERROR: set-returning PL/Perl function must return reference to array or use return_next
334334
CREATE OR REPLACE FUNCTION foo_set_bad() RETURNS SETOF footype AS $$
335335
return [
336336
[1, 2],
337337
[3, 4]
338338
];
339339
$$ LANGUAGE plperl;
340340
SELECT * FROM foo_set_bad();
341-
ERROR: setof-composite-returning Perl function must call return_next with reference to hash
341+
ERROR: SETOF-composite-returning PL/Perl function must call return_next with reference to hash
342342
CREATE OR REPLACE FUNCTION foo_set_bad() RETURNS SETOF footype AS $$
343343
return [
344344
{y => 3, z => 4}

src/pl/plperl/plperl.c

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**********************************************************************
22
* plperl.c - perl as a procedural language for PostgreSQL
33
*
4-
* $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.144 2009/01/07 13:44:37 tgl Exp $
4+
* $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.145 2009/02/19 10:33:17 petere Exp $
55
*
66
**********************************************************************/
77

@@ -199,7 +199,7 @@ _PG_init(void)
199199
pg_bindtextdomain(TEXTDOMAIN);
200200

201201
DefineCustomBoolVariable("plperl.use_strict",
202-
gettext_noop("If true, will compile trusted and untrusted perl code in strict mode"),
202+
gettext_noop("If true, trusted and untrusted Perl code will be compiled in strict mode."),
203203
NULL,
204204
&plperl_use_strict,
205205
false,
@@ -913,7 +913,7 @@ plperl_validator(PG_FUNCTION_ARGS)
913913
proc->prorettype != VOIDOID)
914914
ereport(ERROR,
915915
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
916-
errmsg("plperl functions cannot return type %s",
916+
errmsg("PL/Perl functions cannot return type %s",
917917
format_type_be(proc->prorettype))));
918918
}
919919

@@ -925,7 +925,7 @@ plperl_validator(PG_FUNCTION_ARGS)
925925
if (get_typtype(argtypes[i]) == TYPTYPE_PSEUDO)
926926
ereport(ERROR,
927927
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
928-
errmsg("plperl functions cannot take type %s",
928+
errmsg("PL/Perl functions cannot accept type %s",
929929
format_type_be(argtypes[i]))));
930930
}
931931

@@ -1280,7 +1280,7 @@ plperl_func_handler(PG_FUNCTION_ARGS)
12801280
{
12811281
ereport(ERROR,
12821282
(errcode(ERRCODE_DATATYPE_MISMATCH),
1283-
errmsg("set-returning Perl function must return "
1283+
errmsg("set-returning PL/Perl function must return "
12841284
"reference to array or use return_next")));
12851285
}
12861286

@@ -1313,7 +1313,7 @@ plperl_func_handler(PG_FUNCTION_ARGS)
13131313
{
13141314
ereport(ERROR,
13151315
(errcode(ERRCODE_DATATYPE_MISMATCH),
1316-
errmsg("composite-returning Perl function "
1316+
errmsg("composite-returning PL/Perl function "
13171317
"must return reference to hash")));
13181318
}
13191319

@@ -1438,7 +1438,7 @@ plperl_trigger_handler(PG_FUNCTION_ARGS)
14381438
{
14391439
ereport(WARNING,
14401440
(errcode(ERRCODE_E_R_I_E_TRIGGER_PROTOCOL_VIOLATED),
1441-
errmsg("ignoring modified tuple in DELETE trigger")));
1441+
errmsg("ignoring modified row in DELETE trigger")));
14421442
trv = NULL;
14431443
}
14441444
}
@@ -1447,7 +1447,7 @@ plperl_trigger_handler(PG_FUNCTION_ARGS)
14471447
ereport(ERROR,
14481448
(errcode(ERRCODE_E_R_I_E_TRIGGER_PROTOCOL_VIOLATED),
14491449
errmsg("result of Perl trigger function must be undef, "
1450-
"\"SKIP\" or \"MODIFY\"")));
1450+
"\"SKIP\", or \"MODIFY\"")));
14511451
trv = NULL;
14521452
}
14531453
retval = PointerGetDatum(trv);
@@ -1612,7 +1612,7 @@ compile_plperl_function(Oid fn_oid, bool is_trigger)
16121612
free(prodesc);
16131613
ereport(ERROR,
16141614
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
1615-
errmsg("plperl functions cannot return type %s",
1615+
errmsg("PL/Perl functions cannot return type %s",
16161616
format_type_be(procStruct->prorettype))));
16171617
}
16181618
}
@@ -1659,7 +1659,7 @@ compile_plperl_function(Oid fn_oid, bool is_trigger)
16591659
free(prodesc);
16601660
ereport(ERROR,
16611661
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
1662-
errmsg("plperl functions cannot take type %s",
1662+
errmsg("PL/Perl functions cannot accept type %s",
16631663
format_type_be(procStruct->proargtypes.values[i]))));
16641664
}
16651665

@@ -1902,7 +1902,7 @@ plperl_return_next(SV *sv)
19021902
!(SvOK(sv) && SvTYPE(sv) == SVt_RV && SvTYPE(SvRV(sv)) == SVt_PVHV))
19031903
ereport(ERROR,
19041904
(errcode(ERRCODE_DATATYPE_MISMATCH),
1905-
errmsg("setof-composite-returning Perl function "
1905+
errmsg("SETOF-composite-returning PL/Perl function "
19061906
"must call return_next with reference to hash")));
19071907

19081908
if (!current_call_data->ret_tdesc)

0 commit comments

Comments
 (0)