[postgis-tickets] [PostGIS] #5115: Deferred constraint prevents dropping topology

PostGIS trac at osgeo.org
Fri Mar 18 12:58:42 PDT 2022


#5115: Deferred constraint prevents dropping topology
----------------------+---------------------------
 Reporter:  ccrook    |      Owner:  strk
     Type:  defect    |     Status:  new
 Priority:  medium    |  Milestone:  PostGIS 3.3.0
Component:  topology  |    Version:  3.2.x
 Keywords:            |
----------------------+---------------------------
 I have a use case for creating and dropping a temporary topology in a
 plpgsql procedure.  This fails because of the pending constraint checks.
 The example code is:

 {{{
 DO $script$
 BEGIN
     PERFORM topology.createtopology('mytopology',4167,0.00001);
     PERFORM topology.topogeo_addlinestring('mytopology',ST_SetSRID(
 ST_MakeLine(
               ST_MakePoint(167.0,-45.0),
   ST_MakePoint(167.00001,-45.00001)
 ),4167));
     PERFORM topology.droptopology('mytopology');
 END
 $script$
 }}}

 This generates an error:

 {{{
 ERROR:  cannot DROP TABLE "edge_data" because it has pending trigger
 events
 CONTEXT:  SQL statement "DROP SCHEMA mytopology CASCADE"
 PL/pgSQL function droptopology(character varying) line 38 at EXECUTE
 SQL statement "SELECT topology.droptopology('mytopology')"
 PL/pgSQL function inline_code_block line 9 at PERFORM
 SQL state: 55006
 }}}

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5115>
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