[postgis-tickets] [PostGIS] #5118: DropTopology: ERROR: update or delete on table "topology" violates foreign key constraint "layer_topology_id_fkey" on table "layer"

PostGIS trac at osgeo.org
Mon Mar 28 05:01:24 PDT 2022


#5118: DropTopology: ERROR:  update or delete on table "topology" violates foreign
key constraint "layer_topology_id_fkey" on table "layer"
-----------------------+---------------------------
  Reporter:  strk      |      Owner:  strk
      Type:  defect    |     Status:  new
  Priority:  medium    |  Milestone:  PostGIS 3.3.0
 Component:  topology  |    Version:  3.2.x
Resolution:            |   Keywords:
-----------------------+---------------------------

Comment (by strk):

 It looks like the culprit is DropTopoGeometryColumn silently failing to
 drop the record from topology.layer:
 {{{
 xxx=# select * from topology.layer;
  topology_id | layer_id | schema_name |  table_name   | feature_column |
 feature_type | level | child_id
 -------------+----------+-------------+---------------+----------------+--------------+-------+----------
           17 |        1 | features    | land_parcels  | feature        |
 3 |     0 |
           17 |        2 | features    | traffic_signs | feature        |
 1 |     0 |
           17 |        3 | features    | city_streets  | feature        |
 2 |     0 |
 (3 rows)

 xxx=# SELECT topology.DropTopoGeometryColumn('features', 'land_parcels',
 'feature');
 NOTICE:  sequence "topogeo_s_1" does not exist
 NOTICE:  A record in city_data.relation still references layer 1
              droptopogeometrycolumn
 -------------------------------------------------
  Layer 1 (features.land_parcels.feature) dropped
 (1 row)

 xxx=# select * from topology.layer;
  topology_id | layer_id | schema_name |  table_name   | feature_column |
 feature_type | level | child_id
 -------------+----------+-------------+---------------+----------------+--------------+-------+----------
           17 |        1 | features    | land_parcels  | feature        |
 3 |     0 |
           17 |        2 | features    | traffic_signs | feature        |
 1 |     0 |
           17 |        3 | features    | city_streets  | feature        |
 2 |     0 |
 (3 rows)
 }}}

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5118#comment:2>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list