Do not delete linked stops when deleting artificial sections
Proposition: replace the deletion trigger by:
CREATE OR REPLACE FUNCTION tempus.delete_artificial_stop_road_section_f()
RETURNS trigger AS
$BODY$
begin
delete from tempus.road_node where id in (
select node_from from tempus.road_section where id = OLD.road_section_id AND id NOT IN (SELECT DISTINCT road_section_id FROM tempus_gtfs.stops)
union all
select node_to from tempus.road_section where id = OLD.road_section_id AND id NOT IN (SELECT DISTINCT road_section_id FROM tempus_gtfs.stops)
)
;
delete from tempus.road_section where id = OLD.road_section_id AND id NOT IN (SELECT DISTINCT road_section_id FROM tempus_gtfs.stops);
return OLD;
end;
$BODY$
LANGUAGE plpgsql;