RAISE EXCEPTION 'SQL/MM Spatial exception - null argument';
END IF;
- IF toponame = '' THEN
- RAISE EXCEPTION 'SQL/MM Spatial exception - invalid topology name';
+ IF NOT EXISTS(SELECT name FROM topology WHERE name = toponame) THEN
+ RAISE EXCEPTION 'SQL/MM Spatial exception - invalid topology name';
END IF;
n := 1;
RAISE EXCEPTION 'SQL/MM Spatial exception - null argument';
END IF;
- IF toponame = '' THEN
+ IF NOT EXISTS(SELECT name FROM topology WHERE name = toponame) THEN
RAISE EXCEPTION 'SQL/MM Spatial exception - invalid topology name';
END IF;
RAISE EXCEPTION
'SQL/MM Spatial exception - null argument';
END IF;
+
+ -- Get topology id
+ BEGIN
+ SELECT id FROM topology.topology
+ INTO STRICT topoid WHERE name = atopology;
+ EXCEPTION
+ WHEN NO_DATA_FOUND THEN
+ RAISE EXCEPTION 'SQL/MM Spatial exception - invalid topology name';
+ END;
--
-- Check node existance
|| ' AND edge_id NOT IN (' || edgeid1 || ',' || edgeid2 || ')'
;
- -- Get topology id
- SELECT id FROM topology.topology into topoid
- WHERE name = atopology;
- IF topoid IS NULL THEN
- RAISE EXCEPTION 'No topology % registered',
- quote_ident(atopology);
- END IF;
-
--
-- Update references in the Relation table.
-- We only take into considerations non-hierarchical
END IF;
-- Get topology id
- SELECT id FROM topology.topology into topoid
- WHERE name = atopology;
+ BEGIN
+ SELECT id FROM topology.topology
+ INTO STRICT topoid WHERE name = atopology;
+ EXCEPTION
+ WHEN NO_DATA_FOUND THEN
+ RAISE EXCEPTION 'SQL/MM Spatial exception - invalid topology name';
+ END;
--
-- Check node existance
max|edge|26
ERROR: geometry has too many points at character 53
ERROR: SQL/MM Spatial exception - point not on edge
-ERROR: zero-length delimited identifier at or near """" at character 15
+ERROR: SQL/MM Spatial exception - invalid topology name
ERROR: SQL/MM Spatial exception - null argument
ERROR: SQL/MM Spatial exception - null argument
ERROR: SQL/MM Spatial exception - null argument
-ERROR: schema "fake" does not exist at character 15
+ERROR: SQL/MM Spatial exception - invalid topology name
noniso|23
N|23||POINT(28 14)
E|10|sn13|en23|nl27|nr17|lf7|rf4
max|edge|26
ERROR: geometry has too many points at character 54
ERROR: SQL/MM Spatial exception - point not on edge
-ERROR: zero-length delimited identifier at or near """" at character 15
+ERROR: SQL/MM Spatial exception - invalid topology name
ERROR: SQL/MM Spatial exception - null argument
ERROR: SQL/MM Spatial exception - null argument
ERROR: SQL/MM Spatial exception - null argument
-ERROR: schema "fake" does not exist at character 15
+ERROR: SQL/MM Spatial exception - invalid topology name
noniso|23
N|23||POINT(28 14)
E|27|sn13|en23|nl28|nr17|lf7|rf4