diff options
author | Andrew Dunstan | 2022-12-28 14:53:00 +0000 |
---|---|---|
committer | Andrew Dunstan | 2022-12-28 15:00:12 +0000 |
commit | 3b76622e04d8656fb44e7c932cb243e2d92fe40e (patch) | |
tree | 6840be0512c688b2e92d43b6138fee7465d7030f /contrib/intarray/sql | |
parent | 24b55cd949a11b712927acf2557683976ee149ac (diff) |
Convert contrib/intarray's bqarr_in() 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/intarray/sql')
-rw-r--r-- | contrib/intarray/sql/_int.sql | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/contrib/intarray/sql/_int.sql b/contrib/intarray/sql/_int.sql index b26fc57e4dd..4c9ba4c1fb9 100644 --- a/contrib/intarray/sql/_int.sql +++ b/contrib/intarray/sql/_int.sql @@ -75,6 +75,17 @@ SELECT '1&2&4&5&6'::query_int; SELECT '1&(2&(4&(5|6)))'::query_int; SELECT '1&(2&(4&(5|!6)))'::query_int; +-- test non-error-throwing input + +SELECT str as "query_int", + pg_input_is_valid(str,'query_int') as ok, + pg_input_error_message(str,'query_int') as errmsg +FROM (VALUES ('1&(2&(4&(5|6)))'), + ('1#(2&(4&(5&6)))'), + ('foo')) + AS a(str); + + CREATE TABLE test__int( a int[] ); \copy test__int from 'data/test__int.data' |