Uses "INSERT RETURNING" rather than "SELECT" and "INSERT" for
getting the identifier of new node.
git-svn-id: http://svn.osgeo.org/postgis/trunk@13689
b70326c6-7e19-0410-871a-
916f4a2858ee
END LOOP;
--
- -- Get new node id
- --
- FOR rec IN EXECUTE 'SELECT nextval(''' ||
- atopology || '.node_node_id_seq'')'
- LOOP
- nodeid = rec.nextval;
- END LOOP;
-
- --RAISE NOTICE 'Next node id = % ', nodeid;
-
- --
- -- Add the new node
+ -- Add the new node, returning its identifier
--
EXECUTE 'INSERT INTO ' || quote_ident(atopology)
- || '.node(node_id, geom) VALUES($1, $2)'
+ || '.node(node_id, geom) VALUES(DEFAULT, $2) RETURNING node_id'
+ INTO nodeid
USING nodeid,apoint;
+ --RAISE NOTICE 'Next node id = % ', nodeid;
+
--
-- Compute new edge
--