Opened 7 years ago

Closed 7 years ago

#3196 closed patch (fixed)

DropTopology can drop the topology extension

Reported by: Mike Taves Owned by: strk
Priority: high Milestone: PostGIS 2.0.8
Component: topology Version: master
Keywords: Cc:

Description

On a test database, try the following:

CREATE EXTENSION postgis_topology;
SELECT topology.DropTopology('this does not exist');
-- Topology 'this does not exist' dropped
SELECT topology.DropTopology('topology');
-- Topology 'topology' dropped

The first DropTopology on a non-existing topology shows a misleading message. Either the return value should indicate that the topology does not exist or an exception should be raised.

The second DropTopology kills the topology extension with DROP SCHEMA '||quote_ident(atopology)||' CASCADE, which should have been avoided as topology does not have a topoid. This can be disastrous.

Attachments (3)

droptopology.diff (1.8 KB ) - added by Mike Taves 7 years ago.
patch for trunk
handle_invalid_toponame.2.diff (3.1 KB ) - added by Mike Taves 7 years ago.
correction
handle_invalid_toponame.diff (3.1 KB ) - added by Mike Taves 7 years ago.
correction

Download all attachments as: .zip

Change History (9)

comment:1 by Mike Taves, 7 years ago

Generally speaking DropTopology can also drop other unrelated schemas.

CREATE SCHEMA somethingelse;
SELECT topology.DropTopology('somethingelse');
-- Topology 'somethingelse' dropped

by Mike Taves, 7 years ago

Attachment: droptopology.diff added

patch for trunk

comment:2 by Mike Taves, 7 years ago

Type: defectpatch

A patch on trunk is ready for review. There are only minor changes, but the indent level change adds a bit of noise to the patch. This should be applied (and modified where needed) to 2.0 and 2.1 too.

comment:3 by Mike Taves, 7 years ago

I've added another patch that fixes a few other instances where invalid topography names are attempted. The handle_invalid_toponame.diff​ patch changes these functions:

  • topology.DropTopology
  • topology.GetTopologyId
  • topology.AddTopoGeometryColumn

by Mike Taves, 7 years ago

correction

by Mike Taves, 7 years ago

correction

comment:5 by strk, 7 years ago

Status: newassigned

comment:6 by strk, 7 years ago

Milestone: PostGIS 2.2.0PostGIS 2.0.8
Resolution: fixed
Status: assignedclosed

r13818 in trunk (2.2.0), r13819 in 2.1 branch (2.1.9), r13820 in 2.0 branch (2.0.8) — Thanks !

Note: See TracTickets for help on using tickets.