diff options
| author | Tom Lane | 2020-03-31 14:30:59 +0000 |
|---|---|---|
| committer | Tom Lane | 2020-03-31 15:14:42 +0000 |
| commit | e07e2a40bd0c3c02a9baf2e5ddccf665e73208fb (patch) | |
| tree | 52913530ce5e51a531324d024bf61bbb51852041 /contrib/ltree/expected | |
| parent | 02a5786df24b12c6379ef1b0375b70b8a9fb4925 (diff) | |
Improve error messages in ltree_in and lquery_in.
Ensure that the type name is mentioned in all cases (bare "syntax error"
isn't that helpful). Avoid using the term "level", since that's not
used in the documentation. Phrase error position reports as "at
character N" not "in position N"; the latter seems ambiguous, and it's
certainly not how we say it elsewhere. For the same reason, make the
character position values be 1-based not 0-based. Provide a position
in more cases. (I continued to leave that out of messages complaining
about end-of-input, where it seemed pointless, as well as messages
complaining about overall input complexity, where fingering any one part
of the input would be arbitrary.)
Discussion: https://postgr.es/m/15582.1585529626@sss.pgh.pa.us
Diffstat (limited to 'contrib/ltree/expected')
| -rw-r--r-- | contrib/ltree/expected/ltree.out | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/contrib/ltree/expected/ltree.out b/contrib/ltree/expected/ltree.out index c78d372b638..610cb6f3266 100644 --- a/contrib/ltree/expected/ltree.out +++ b/contrib/ltree/expected/ltree.out @@ -464,7 +464,7 @@ SELECT nlevel(('1' || repeat('.1', 65534))::ltree); (1 row) SELECT nlevel(('1' || repeat('.1', 65535))::ltree); -ERROR: number of ltree levels (65536) exceeds the maximum allowed (65535) +ERROR: number of ltree labels (65536) exceeds the maximum allowed (65535) SELECT nlevel(('1' || repeat('.1', 65534))::ltree || '1'); ERROR: number of ltree levels (65536) exceeds the maximum allowed (65535) SELECT ('1' || repeat('.1', 65534))::lquery IS NULL; @@ -474,7 +474,7 @@ SELECT ('1' || repeat('.1', 65534))::lquery IS NULL; (1 row) SELECT ('1' || repeat('.1', 65535))::lquery IS NULL; -ERROR: number of lquery levels (65536) exceeds the maximum allowed (65535) +ERROR: number of lquery items (65536) exceeds the maximum allowed (65535) SELECT '*{65535}'::lquery; lquery ---------- @@ -485,7 +485,7 @@ SELECT '*{65536}'::lquery; ERROR: lquery syntax error LINE 1: SELECT '*{65536}'::lquery; ^ -DETAIL: Low limit (65536) exceeds the maximum allowed (65535). +DETAIL: Low limit (65536) exceeds the maximum allowed (65535), at character 3. SELECT '*{,65534}'::lquery; lquery ----------- @@ -502,7 +502,12 @@ SELECT '*{,65536}'::lquery; ERROR: lquery syntax error LINE 1: SELECT '*{,65536}'::lquery; ^ -DETAIL: High limit (65536) exceeds the maximum allowed (65535). +DETAIL: High limit (65536) exceeds the maximum allowed (65535), at character 4. +SELECT '*{4,3}'::lquery; +ERROR: lquery syntax error +LINE 1: SELECT '*{4,3}'::lquery; + ^ +DETAIL: Low limit (4) is greater than high limit (3), at character 5. SELECT '1.2'::ltree < '2.2'::ltree; ?column? ---------- |
