diff options
| author | Tom Lane | 2014-12-02 23:23:16 +0000 |
|---|---|---|
| committer | Tom Lane | 2014-12-02 23:23:27 +0000 |
| commit | 475aedd1ef0c0f9fc9d675dd2286380d14804975 (patch) | |
| tree | b237c4f2504714f8dc8ee3fca32754ef0a106abc /src/pl | |
| parent | 0fd38e13706e6bd4b2a4ce4e0570d0aa4ad65345 (diff) | |
Improve error messages for malformed array input strings.
Make the error messages issued by array_in() uniformly follow the style
ERROR: malformed array literal: "actual input string"
DETAIL: specific complaint here
and rewrite many of the specific complaints to be clearer.
The immediate motivation for doing this is a complaint from Josh Berkus
that json_to_record() produced an unintelligible error message when
dealing with an array item, because it tries to feed the JSON-format
array value to array_in(). Really it ought to be smart enough to
perform JSON-to-Postgres array conversion, but that's a future feature
not a bug fix. In the meantime, this change is something we agreed
we could back-patch into 9.4, and it should help de-confuse things a bit.
Diffstat (limited to 'src/pl')
| -rw-r--r-- | src/pl/plperl/expected/plperl_array.out | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pl/plperl/expected/plperl_array.out b/src/pl/plperl/expected/plperl_array.out index d21c84bd98..6347b5211d 100644 --- a/src/pl/plperl/expected/plperl_array.out +++ b/src/pl/plperl/expected/plperl_array.out @@ -65,9 +65,10 @@ ERROR: number of array dimensions (7) exceeds the maximum allowed (6) LINE 1: select plperl_sum_array('{{{{{{{1,2},{3,4}},{{5,6},{7,8}}},{... ^ select plperl_sum_array('{{{1,2,3}, {4,5,6,7}}, {{7,8,9}, {10, 11, 12}}}'); -ERROR: multidimensional arrays must have array expressions with matching dimensions +ERROR: malformed array literal: "{{{1,2,3}, {4,5,6,7}}, {{7,8,9}, {10, 11, 12}}}" LINE 1: select plperl_sum_array('{{{1,2,3}, {4,5,6,7}}, {{7,8,9}, {1... ^ +DETAIL: Multidimensional arrays must have sub-arrays with matching dimensions. CREATE OR REPLACE FUNCTION plperl_concat(TEXT[]) RETURNS TEXT AS $$ my $array_arg = shift; my $result = ""; |
