名称

Populate_Topology_Layer — 通过读取拓扑表中的元数据,向 topology.layer 表添加缺失的条目。

概要

setof record Populate_Topology_Layer();

描述

通过检查表上的拓扑约束,向 topology.layer 表添加缺失的条目。此函数对于修复具有拓扑数据的模式还原后拓扑目录中的条目很有用。

它返回创建的条目列表。返回的列为 schema_nametable_namefeature_column

可用性:2.3.0

示例

SELECT CreateTopology('strk_topo');
CREATE SCHEMA strk;
CREATE TABLE strk.parcels(gid serial, parcel_id varchar(20) PRIMARY KEY, address text);
SELECT topology.AddTopoGeometryColumn('strk_topo', 'strk', 'parcels', 'topo', 'POLYGON');
-- this will return no records because this feature is already registered
SELECT *
  FROM topology.Populate_Topology_Layer();

-- let's rebuild
TRUNCATE TABLE topology.layer;

SELECT *
  FROM topology.Populate_Topology_Layer();

SELECT topology_id,layer_id, schema_name As sn, table_name As tn, feature_column As fc
FROM topology.layer;

				
 schema_name | table_name | feature_column
-------------+------------+----------------
 strk        | parcels    | topo
(1 row)

 topology_id | layer_id |  sn  |   tn    |  fc
-------------+----------+------+---------+------
           2 |        2 | strk | parcels | topo
(1 row)

另请参阅

AddTopoGeometryColumn