1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Convert contrib/isn's input functions to report errors softly

This commit is contained in:
Andrew Dunstan
2022-12-24 15:28:13 -05:00
parent e37fe1db6e
commit 720e0327bc
3 changed files with 63 additions and 44 deletions

View File

@ -107,6 +107,15 @@ SELECT '12345679'::ISSN = '9771234567003'::EAN13 AS "ok",
'M-1234-5678-5'::ISMN = '9790123456785'::EAN13 AS "ok",
'9791234567896'::EAN13 != '123456789X'::ISBN AS "nope";
-- test non-error-throwing input API
SELECT str as isn, typ as "type",
pg_input_is_valid(str,typ) as ok,
pg_input_error_message(str,typ) as errmsg
FROM (VALUES ('9780123456786', 'UPC'),
('postgresql...','EAN13'),
('9771234567003','ISSN'))
AS a(str,typ);
--
-- cleanup
--