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

Function: st_inittopogeo

 

 

Schema

topology

 

Owner

postgres

 

Descriptions

args: topology_schema_name - Creates a new topology schema and registers this new schema in the topology.topology table and details summary of process.

 

Options

Option

Value

Returns

text

Language

plpgsql

Parameters

atopology varchar

 

Definition

CREATE OR REPLACE FUNCTION topology.st_inittopogeo (
 atopology varchar
)
RETURNS text AS
$span$
DECLARE

 rec RECORD;
 topology_id numeric;
BEGIN
 IF
atopology IS NULL THEN
   RAISE EXCEPTION
'SQL/MM Spatial exception - null argument';
 END IF;

 FOR rec IN SELECT * FROM pg_namespace WHERE text(nspname) = atopology
 LOOP
   RAISE EXCEPTION
'SQL/MM Spatial exception - schema already exists';
 END LOOP;

 FOR rec IN EXECUTE 'SELECT topology.CreateTopology('
   ||quote_literal(atopology)|| ') as id'
 LOOP
   topology_id := rec.id;
 END LOOP;

 RETURN 'Topology-Geometry ' || quote_literal(atopology)
   || ' (id:' || topology_id || ') created.';
END
$span$
LANGUAGE
'plpgsql'
VOLATILE
CALLED ON NULL INPUT
SECURITY INVOKER
COST
100;

COMMENT ON FUNCTION topology.st_inittopogeo(atopology varchar)
IS 'args: topology_schema_name - Creates a new topology schema and registers this new schema in the topology.topology table and details summary of process.';

This file was generated with SQL Manager for PostgreSQL (www.pgsqlmanager.com) at 13/03/2014 13:23
Previous topic Chapter index Next topic