Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5829738

Browse files
committed
Do not prefix error messages with the string "PL/Python: "
It is redundant, given the error context.Jan Urbański
1 parent582b5ac commit5829738

File tree

8 files changed

+24
-24
lines changed

8 files changed

+24
-24
lines changed

‎src/pl/plpython/expected/plpython_do.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ DO $$ plpy.notice("This is plpythonu.") $$ LANGUAGE plpythonu;
22
NOTICE: This is plpythonu.
33
CONTEXT: PL/Python anonymous code block
44
DO $$ nonsense $$ LANGUAGE plpythonu;
5-
ERROR:PL/Python:NameError: global name 'nonsense' is not defined
5+
ERROR: NameError: global name 'nonsense' is not defined
66
CONTEXT: PL/Python anonymous code block

‎src/pl/plpython/expected/plpython_error.out

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ CREATE FUNCTION sql_syntax_error() RETURNS text
88
'plpy.execute("syntax error")'
99
LANGUAGE plpythonu;
1010
SELECT sql_syntax_error();
11-
WARNING:PL/Python:plpy.SPIError: unrecognized error in PLy_spi_execute_query
11+
WARNING: plpy.SPIError: unrecognized error in PLy_spi_execute_query
1212
CONTEXT: PL/Python function "sql_syntax_error"
13-
ERROR:PL/Python:plpy.SPIError: syntax error at or near "syntax"
13+
ERROR: plpy.SPIError: syntax error at or near "syntax"
1414
LINE 1: syntax error
1515
^
1616
QUERY: syntax error
@@ -22,7 +22,7 @@ CREATE FUNCTION exception_index_invalid(text) RETURNS text
2222
'return args[1]'
2323
LANGUAGE plpythonu;
2424
SELECT exception_index_invalid('test');
25-
ERROR:PL/Python:IndexError: list index out of range
25+
ERROR: IndexError: list index out of range
2626
CONTEXT: PL/Python function "exception_index_invalid"
2727
/* check handling of nested exceptions
2828
*/
@@ -32,9 +32,9 @@ CREATE FUNCTION exception_index_invalid_nested() RETURNS text
3232
return rv[0]'
3333
LANGUAGE plpythonu;
3434
SELECT exception_index_invalid_nested();
35-
WARNING:PL/Python:plpy.SPIError: unrecognized error in PLy_spi_execute_query
35+
WARNING: plpy.SPIError: unrecognized error in PLy_spi_execute_query
3636
CONTEXT: PL/Python function "exception_index_invalid_nested"
37-
ERROR:PL/Python:plpy.SPIError: function test5(unknown) does not exist
37+
ERROR: plpy.SPIError: function test5(unknown) does not exist
3838
LINE 1: SELECT test5('foo')
3939
^
4040
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
@@ -54,9 +54,9 @@ return None
5454
'
5555
LANGUAGE plpythonu;
5656
SELECT invalid_type_uncaught('rick');
57-
WARNING:PL/Python:plpy.SPIError: unrecognized error in PLy_spi_prepare
57+
WARNING: plpy.SPIError: unrecognized error in PLy_spi_prepare
5858
CONTEXT: PL/Python function "invalid_type_uncaught"
59-
ERROR:PL/Python:plpy.SPIError: type "test" does not exist
59+
ERROR: plpy.SPIError: type "test" does not exist
6060
CONTEXT: PL/Python function "invalid_type_uncaught"
6161
/* for what it's worth catch the exception generated by
6262
* the typo, and return None
@@ -77,7 +77,7 @@ return None
7777
'
7878
LANGUAGE plpythonu;
7979
SELECT invalid_type_caught('rick');
80-
WARNING:PL/Python:plpy.SPIError: unrecognized error in PLy_spi_prepare
80+
WARNING: plpy.SPIError: unrecognized error in PLy_spi_prepare
8181
CONTEXT: PL/Python function "invalid_type_caught"
8282
NOTICE: type "test" does not exist
8383
CONTEXT: PL/Python function "invalid_type_caught"
@@ -104,9 +104,9 @@ return None
104104
'
105105
LANGUAGE plpythonu;
106106
SELECT invalid_type_reraised('rick');
107-
WARNING:PL/Python:plpy.SPIError: unrecognized error in PLy_spi_prepare
107+
WARNING: plpy.SPIError: unrecognized error in PLy_spi_prepare
108108
CONTEXT: PL/Python function "invalid_type_reraised"
109-
ERROR:PL/Python:plpy.Error: type "test" does not exist
109+
ERROR: plpy.Error: type "test" does not exist
110110
CONTEXT: PL/Python function "invalid_type_reraised"
111111
/* no typo no messing about
112112
*/

‎src/pl/plpython/expected/plpython_test.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,5 @@ NOTICE: notice
7373
CONTEXT: PL/Python function "elog_test"
7474
WARNING: warning
7575
CONTEXT: PL/Python function "elog_test"
76-
ERROR:PL/Python:plpy.Error: error
76+
ERROR: plpy.Error: error
7777
CONTEXT: PL/Python function "elog_test"

‎src/pl/plpython/expected/plpython_types.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ CREATE FUNCTION test_type_conversion_array_error() RETURNS int[] AS $$
596596
return 5
597597
$$ LANGUAGE plpythonu;
598598
SELECT * FROM test_type_conversion_array_error();
599-
ERROR:PL/Python:return value of function with array return type is not a Python sequence
599+
ERROR: return value of function with array return type is not a Python sequence
600600
CONTEXT: while creating return value
601601
PL/Python function "test_type_conversion_array_error"
602602
--

‎src/pl/plpython/expected/plpython_types_3.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ CREATE FUNCTION test_type_conversion_array_error() RETURNS int[] AS $$
596596
return 5
597597
$$ LANGUAGE plpython3u;
598598
SELECT * FROM test_type_conversion_array_error();
599-
ERROR:PL/Python:return value of function with array return type is not a Python sequence
599+
ERROR: return value of function with array return type is not a Python sequence
600600
CONTEXT: while creating return value
601601
PL/Python function "test_type_conversion_array_error"
602602
--

‎src/pl/plpython/expected/plpython_unicode_2.out

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ rv = plpy.execute(plan, ["foo", "bar"], 1)
2424
return rv[0]["testvalue"]
2525
' LANGUAGE plpythonu;
2626
SELECT unicode_return();
27-
ERROR:PL/Python:could not convert Python Unicode object to PostgreSQL server encoding
27+
ERROR: could not convert Python Unicode object to PostgreSQL server encoding
2828
DETAIL: UnicodeError: ASCII encoding error: ordinal not in range(128)
2929
CONTEXT: while creating return value
3030
PL/Python function "unicode_return"
3131
INSERT INTO unicode_test (testvalue) VALUES ('test');
32-
ERROR:PL/Python:could not convert Python Unicode object to PostgreSQL server encoding
32+
ERROR: could not convert Python Unicode object to PostgreSQL server encoding
3333
DETAIL: UnicodeError: ASCII encoding error: ordinal not in range(128)
3434
CONTEXT: while modifying trigger row
3535
PL/Python function "unicode_trigger"
@@ -39,9 +39,9 @@ SELECT * FROM unicode_test;
3939
(0 rows)
4040

4141
SELECT unicode_plan1();
42-
WARNING:PL/Python:plpy.SPIError: unrecognized error in PLy_spi_execute_plan
42+
WARNING: plpy.SPIError: unrecognized error in PLy_spi_execute_plan
4343
CONTEXT: PL/Python function "unicode_plan1"
44-
ERROR:PL/Python:plpy.SPIError: PL/Python: could not convert Python Unicode object to PostgreSQL server encoding
44+
ERROR: plpy.SPIError: could not convert Python Unicode object to PostgreSQL server encoding
4545
DETAIL: UnicodeError: ASCII encoding error: ordinal not in range(128)
4646
CONTEXT: PL/Python function "unicode_plan1"
4747
SELECT unicode_plan2();

‎src/pl/plpython/expected/plpython_unicode_3.out

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ rv = plpy.execute(plan, ["foo", "bar"], 1)
2424
return rv[0]["testvalue"]
2525
' LANGUAGE plpythonu;
2626
SELECT unicode_return();
27-
ERROR:PL/Python:could not convert Python Unicode object to PostgreSQL server encoding
27+
ERROR: could not convert Python Unicode object to PostgreSQL server encoding
2828
DETAIL: UnicodeEncodeError: 'ascii' codec can't encode character u'\x80' in position 0: ordinal not in range(128)
2929
CONTEXT: while creating return value
3030
PL/Python function "unicode_return"
3131
INSERT INTO unicode_test (testvalue) VALUES ('test');
32-
ERROR:PL/Python:could not convert Python Unicode object to PostgreSQL server encoding
32+
ERROR: could not convert Python Unicode object to PostgreSQL server encoding
3333
DETAIL: UnicodeEncodeError: 'ascii' codec can't encode character u'\x80' in position 0: ordinal not in range(128)
3434
CONTEXT: while modifying trigger row
3535
PL/Python function "unicode_trigger"
@@ -39,9 +39,9 @@ SELECT * FROM unicode_test;
3939
(0 rows)
4040

4141
SELECT unicode_plan1();
42-
WARNING:PL/Python:plpy.SPIError: unrecognized error in PLy_spi_execute_plan
42+
WARNING: plpy.SPIError: unrecognized error in PLy_spi_execute_plan
4343
CONTEXT: PL/Python function "unicode_plan1"
44-
ERROR:PL/Python:plpy.SPIError: PL/Python: could not convert Python Unicode object to PostgreSQL server encoding
44+
ERROR: plpy.SPIError: could not convert Python Unicode object to PostgreSQL server encoding
4545
DETAIL: UnicodeEncodeError: 'ascii' codec can't encode character u'\x80' in position 0: ordinal not in range(128)
4646
CONTEXT: PL/Python function "unicode_plan1"
4747
SELECT unicode_plan2();

‎src/pl/plpython/plpython.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3615,14 +3615,14 @@ PLy_elog(int elevel, const char *fmt,...)
36153615
{
36163616
if (fmt)
36173617
ereport(elevel,
3618-
(errmsg("PL/Python:%s",emsg.data),
3618+
(errmsg("%s",emsg.data),
36193619
(xmsg) ?errdetail("%s",xmsg) :0,
36203620
(hint) ?errhint("%s",hint) :0,
36213621
(query) ?internalerrquery(query) :0,
36223622
(position) ?internalerrposition(position) :0));
36233623
else
36243624
ereport(elevel,
3625-
(errmsg("PL/Python:%s",xmsg),
3625+
(errmsg("%s",xmsg),
36263626
(detail) ?errdetail("%s",detail) :0,
36273627
(hint) ?errhint("%s",hint) :0,
36283628
(query) ?internalerrquery(query) :0,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp