Schema
Owner
postgres
Descriptions
args: topogeom - Clears the content of a topo geometry
Options
Option | Value |
---|---|
Returns |
topology.topogeometry |
Language |
|
Parameters |
tg topology.topogeometry |
Definition
CREATE OR REPLACE FUNCTION topology.cleartopogeom (
tg topology.topogeometry
)
RETURNS topology.topogeometry AS
$span$
DECLARE
topology_info RECORD;
sql TEXT;
BEGIN
-- Get topology information
SELECT id, name FROM topology.topology
INTO topology_info
WHERE id = topology_id(tg);
IF NOT FOUND THEN
RAISE EXCEPTION 'No topology with id "%" in topology.topology', topology_id(tg);
END IF;
-- Clear the TopoGeometry contents
sql := 'DELETE FROM ' || quote_ident(topology_info.name)
|| '.relation WHERE layer_id = '
|| layer_id(tg)
|| ' AND topogeo_id = '
|| id(tg);
EXECUTE sql;
RETURN tg;
END
$span$
LANGUAGE 'plpgsql'
VOLATILE
RETURNS NULL ON NULL INPUT
SECURITY INVOKER
COST 100;
COMMENT ON FUNCTION topology.cleartopogeom(tg topology.topogeometry)
IS 'args: topogeom - Clears the content of a topo geometry';
This file was generated with SQL Manager for PostgreSQL (www.pgsqlmanager.com) at 13/03/2014 13:23 |