mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
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
This commit is contained in:
@ -382,3 +382,18 @@ SELECT count(*) FROM _ltreetest WHERE t ~ '23.*{1}.1' ;
|
||||
SELECT count(*) FROM _ltreetest WHERE t ~ '23.*.1' ;
|
||||
SELECT count(*) FROM _ltreetest WHERE t ~ '23.*.2' ;
|
||||
SELECT count(*) FROM _ltreetest WHERE t ? '{23.*.1,23.*.2}' ;
|
||||
|
||||
-- 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);
|
||||
|
Reference in New Issue
Block a user