[postgis-tickets] [PostGIS] #5334: topology edge view doesn't need a rule to insert data

PostGIS trac at osgeo.org
Tue Feb 7 08:51:20 PST 2023


#5334: topology edge view doesn't need a rule to insert data
-----------------------+---------------------------
  Reporter:  robe      |      Owner:  strk
      Type:  defect    |     Status:  new
  Priority:  medium    |  Milestone:  PostGIS 3.4.0
 Component:  topology  |    Version:  master
Resolution:            |   Keywords:
-----------------------+---------------------------
Comment (by robe):

 Replying to [comment:2 strk]:
 > Oh I was wrong, the INSERT INTO edge does work at doing the abs() thing:
 > {{{
 > =# insert into test.edge values (1,1,2,-1,1,0,0,'LINESTRING(0 0, 10
 0)');
 > INSERT 0 1
 > =# select * from test.edge_data;
 > -[ RECORD 1
 ]-------+-----------------------------------------------------------------------------------
 > edge_id             | 1
 > start_node          | 1
 > end_node            | 2
 > next_left_edge      | -1
 > abs_next_left_edge  | 1
 > next_right_edge     | 1
 > abs_next_right_edge | 1
 > left_face           | 0
 > right_face          | 0
 > geom                |
 0102000000020000000000000000000000000000000000000000000000000024400000000000000000
 > }}}
 >
 > Would that work w/out our own rule ?


 Okay I missed you were doing something extra, so nevermind about my
 complaint there.

 Though I think you might still be better off getting rid of the rule and
 putting a trigger directly on the edge_data table.  Cause with the view,
 this is only going to work if someone inserts into the view.  It won't
 work if they insert directly into edge_data table.

 Also I think PostgreSQL is trying to phase out use of rules and has been
 for a while, so better to go with a TRIGGER or an INSTEAD OF trigger.
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5334#comment:4>
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