Name

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

Synopsis

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