Here we take much of the work covered in post 010 and take the parts and user st_union to merge into a single record and place it in a table created by transforming a view into a table
Firstly go to your psql line and ensure that you are logged in with a username that you wish to be the owner of the table. In my case general

Now same measurement as before but this time we shall make a view out of the measurements then load that into a new table before deleting the view leaving us with the table with a combined measurement.
CREATE VIEW v001firstmeasurement AS SELECT seq, id1 AS node, id2 AS edge, cost, geom, agg FROM pgr_dijkstra( 'SELECT id, source, target, st_length(geom) as cost FROM public.t01roadnetwork', 15883, 10967, false, false ) as di JOIN public.t01roadnetwork pt ON di.id2 = pt.id ; CREATE TABLE t003 as select sum(cost), st_union(geom) from v001firstmeasurement; DROP VIEW v001firstmeasurement;
It is important in notepad to remove the blank spaces in the editor this looks as follows.



insert into t003(sum,st_union) select sum(cost),st_union(geom) from v001firstmeasurement;This would allow you to do multiple measurments. I haven’t added up the measurement but it looks about right.