I want to slit line at intersection and attach attributes and export
I have roads table with columns id,road_name,road_type,geom with 2115 records. I try using this query -
select st_astext((st_dump(st_union(geom))).geom) from roads;
it successfully splits the line gives 5114 records but when i am trying to attach attributes it fails
select id,road_name,road_type,st_astext((st_dump(st_union(geom))).geom) from roads;
I need to split line at intersection also keep attributes means line 1 divide in 3 having same id is 1 , road_name is abc similar to line 2 divide in 2 having same id is 2 , road_name is xyz and so on.