Opened 8 years ago

Closed 6 years ago

#3507 closed defect (wontfix)

topology.relation trigger guard insert/update but no delete

Reported by: strk Owned by: strk
Priority: medium Milestone: PostGIS 2.5.0
Component: topology Version: 2.0.x
Keywords: Cc:

Description

Deleting records from topology "relation" table can break the definition of hierarchical TopoGeometry objects but such broken dataset cannot be copied into a new "relation" table. This becomes clear on CopyTopology, which fails when it finds such "broken" tables.

I guess the fix here would be to have the "relation_integrity_checks" trigger also run before DELETE.

Change History (4)

comment:1 by robe, 8 years ago

Component: postgistopology
Owner: changed from pramsey to strk

comment:2 by robe, 8 years ago

Milestone: PostGIS 2.3.0PostGIS 2.4.0

comment:3 by dbaston, 7 years ago

Milestone: PostGIS 2.4.0PostGIS 2.5.0

comment:4 by robe, 6 years ago

Resolution: wontfix
Status: newclosed

I checked the relationtrigger function that is called for the relation_integrity_checks. It returns error if you try to call against a DELETE event.

I don't see an easy way of checking in before delete anyway.

In the case of delete from relation, you have two problems

1) You have to find all references of the topogeometry in the database to make sure it is not in use anymore (otherwise your topogeometry is broken). This can be huge check for each run of before delete. The performance hit is not worth the problem in my opinion, though I guess we can do some tests.

2) You can't allow a partial delete of a topogeometry (presumably) - I suppose merges and so forth might change things and since you only get one record at a time in the before delete trigger, not sure how you would be able to check after all deletes that you are not left with a partial topogeometry.

That said I think this problem is unsolvable with triggers. You need to change the management functions to accomodate.

I'm dismissing this as a wontfix.

strk if you have other thoughts, feel free to reopen.

Note: See TracTickets for help on using tickets.