pggeodb-preprod.nancy.inra.fr/db_onf_gde - db_onf_gde on pggeodb-preprod.nancy.inra.fr
Previous topic Chapter index Next topic

Function: cleartopogeom

 

 

Schema

topology

 

Owner

postgres

 

Descriptions

args: topogeom - Clears the content of a topo geometry

 

Options

Option

Value

Returns

topology.topogeometry

Language

plpgsql

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 07/12/2018 13:23
Previous topic Chapter index Next topic