comparison schema/isrs_tests.sql @ 2081:40711ca3aa19

Add function to get text representation of location code The text representation is appropriate for user visible output as well as for use in SQL expressions where the composite type is not supported.
author Tom Gottfried <tom@intevation.de>
date Thu, 31 Jan 2019 12:36:54 +0100
parents f9f1babe52ae
children 7936b46a88d4
comparison
equal deleted inserted replaced
2080:1dafdbfca100 2081:40711ca3aa19
26 SELECT throws_ok($$ 26 SELECT throws_ok($$
27 SELECT isrs_fromText('DEUXXX039000000005023') 27 SELECT isrs_fromText('DEUXXX039000000005023')
28 $$, 28 $$,
29 22023, NULL, 29 22023, NULL,
30 'ISRS text input needs to have correct length'); 30 'ISRS text input needs to have correct length');
31
32 SELECT ok(
33 'DEBON03901G007906548' = isrs_asText(isrs_fromText('DEBON03901G007906548'))
34 ,
35 'isrs_asText() is the inverse of isrs_fromText()');
31 36
32 SELECT ok( 37 SELECT ok(
33 ISRSrange_area(isrsrange( 38 ISRSrange_area(isrsrange(
34 ('AT', 'XXX', '00001', '00000', 0)::isrs, 39 ('AT', 'XXX', '00001', '00000', 0)::isrs,
35 ('AT', 'XXX', '00001', '00000', 1)::isrs), 40 ('AT', 'XXX', '00001', '00000', 1)::isrs),