diff options
| author | Andrew Dunstan | 2022-12-28 14:58:04 +0000 |
|---|---|---|
| committer | Andrew Dunstan | 2022-12-28 15:00:12 +0000 |
| commit | 7a05425d96742acff5ebfacf307711385c88429b (patch) | |
| tree | 3c97dce8ee83be47b9c03851e79f35d474830204 /contrib/ltree/expected | |
| parent | 3b76622e04d8656fb44e7c932cb243e2d92fe40e (diff) | |
Convert contrib/ltree's input functions to report errors softly
Reviewed by Tom Lane and Amul Sul
Discussion: https://postgr.es/m/49e598c2-cfe8-0928-b6fb-d0cc51aab626@dunslane.net
Diffstat (limited to 'contrib/ltree/expected')
| -rw-r--r-- | contrib/ltree/expected/ltree.out | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/contrib/ltree/expected/ltree.out b/contrib/ltree/expected/ltree.out index c6d8f3ef75e..b95be71c781 100644 --- a/contrib/ltree/expected/ltree.out +++ b/contrib/ltree/expected/ltree.out @@ -8084,3 +8084,28 @@ SELECT count(*) FROM _ltreetest WHERE t ? '{23.*.1,23.*.2}' ; 15 (1 row) +-- test non-error-throwing input +SELECT str as "value", typ as "type", + pg_input_is_valid(str,typ) as ok, + pg_input_error_message(str,typ) as errmsg +FROM (VALUES ('.2.3', 'ltree'), + ('1.2.', 'ltree'), + ('1.2.3','ltree'), + ('@.2.3','lquery'), + (' 2.3', 'lquery'), + ('1.2.3','lquery'), + ('$tree & aWdf@*','ltxtquery'), + ('!tree & aWdf@*','ltxtquery')) + AS a(str,typ); + value | type | ok | errmsg +----------------+-----------+----+------------------------------------ + .2.3 | ltree | f | ltree syntax error at character 1 + 1.2. | ltree | f | ltree syntax error + 1.2.3 | ltree | t | + @.2.3 | lquery | f | lquery syntax error at character 1 + 2.3 | lquery | f | lquery syntax error at character 1 + 1.2.3 | lquery | t | + $tree & aWdf@* | ltxtquery | f | operand syntax error + !tree & aWdf@* | ltxtquery | t | +(8 rows) + |
