update insar.insarlow_ps_dsc set
pnt_lon = split_part(pnt_id, ',', 3)::float,
pnt_rdx = split_part(pnt_id, ',', 4)::float,
pnt_rdy = split_part(pnt_id, ',', 5)::float,
pnt_demheight = split_part(pnt_id, ',', 6)::float,
pnt_height = split_part(pnt_id, ',', 7)::float,
pnt_quality = split_part(pnt_id, ',', 8)::float,
pnt_linear = split_part(pnt_id, ',', 9)::float,
d_20131122 = split_part(pnt_id, ',', 10)::float,
d_20131203 = split_part(pnt_id, ',', 11)::float,
d_20131214 = split_part(pnt_id, ',', 12)::float,
d_20131225 = split_part(pnt_id, ',', 13)::float,
d_20140105 = split_part(pnt_id, ',', 14)::float,
d_20140116 = split_part(pnt_id, ',', 15)::float,
d_20140127 = split_part(pnt_id, ',', 16)::float,
d_20140207 = split_part(pnt_id, ',', 17)::float,
d_20140218 = split_part(pnt_id, ',', 18)::float,
d_20140312 = split_part(pnt_id, ',', 19)::float,
d_20140403 = split_part(pnt_id, ',', 20)::float,
d_20140517 = split_part(pnt_id, ',', 21)::float,
d_20140722 = split_part(pnt_id, ',', 22)::float,
d_20140915 = split_part(pnt_id, ',', 23)::float,
d_20140926 = split_part(pnt_id, ',', 24)::float,
d_20141007 = split_part(pnt_id, ',', 25)::float,
d_20141018 = split_part(pnt_id, ',', 26)::float,
d_20141029 = split_part(pnt_id, ',', 27)::float,
d_20141109 = split_part(pnt_id, ',', 28)::float,
d_20141120 = split_part(pnt_id, ',', 29)::float,
d_20141201 = split_part(pnt_id, ',', 30)::float,
d_20141212 = split_part(pnt_id, ',', 31)::float,
d_20150114 = split_part(pnt_id, ',', 32)::float,
d_20150205 = split_part(pnt_id, ',', 33)::float,
d_20150216 = split_part(pnt_id, ',', 34)::float,
d_20150227 = split_part(pnt_id, ',', 35)::float,
d_20150310 = split_part(pnt_id, ',', 36)::float,
d_20150321 = split_part(pnt_id, ',', 37)::float,
d_20150401 = split_part(pnt_id, ',', 38)::float,
d_20150412 = split_part(pnt_id, ',', 39)::float,
d_20150423 = split_part(pnt_id, ',', 40)::float,
d_20150504 = split_part(pnt_id, ',', 41)::float,
d_20150515 = split_part(pnt_id, ',', 42)::float,
d_20150526 = split_part(pnt_id, ',', 43)::float,
d_20150606 = split_part(pnt_id, ',', 44)::float,
d_20150617 = split_part(pnt_id, ',', 45)::float,
d_20150628 = split_part(pnt_id, ',', 46)::float,
d_20150709 = split_part(pnt_id, ',', 47)::float,
d_20150720 = split_part(pnt_id, ',', 48)::float,
d_20150731 = split_part(pnt_id, ',', 49)::float,
d_20150811 = split_part(pnt_id, ',', 50)::float,
d_20150822 = split_part(pnt_id, ',', 51)::float,
d_20150902 = split_part(pnt_id, ',', 52)::float,
d_20150913 = split_part(pnt_id, ',', 53)::float,
d_20150924 = split_part(pnt_id, ',', 54)::float,
d_20151005 = split_part(pnt_id, ',', 55)::float,
d_20151016 = split_part(pnt_id, ',', 56)::float,
d_20151027 = split_part(pnt_id, ',', 57)::float,
d_20151107 = split_part(pnt_id, ',', 58)::float,
d_20151118 = split_part(pnt_id, ',', 59)::float,
d_20151129 = split_part(pnt_id, ',', 60)::float,
d_20151221 = split_part(pnt_id, ',', 61)::float,
d_20160101 = split_part(pnt_id, ',', 62)::float,
d_20160123 = split_part(pnt_id, ',', 63)::float,
d_20160203 = split_part(pnt_id, ',', 64)::float,
d_20160214 = split_part(pnt_id, ',', 65)::float,
d_20160225 = split_part(pnt_id, ',', 66)::float,
d_20160307 = split_part(pnt_id, ',', 67)::float,
d_20160318 = split_part(pnt_id, ',', 68)::float,
d_20160329 = split_part(pnt_id, ',', 69)::float,
d_20160409 = split_part(pnt_id, ',', 70)::float,
d_20160420 = split_part(pnt_id, ',', 71)::float,
d_20160501 = split_part(pnt_id, ',', 72)::float,
d_20160512 = split_part(pnt_id, ',', 73)::float,
d_20160523 = split_part(pnt_id, ',', 74)::float,
d_20160603 = split_part(pnt_id, ',', 75)::float,
d_20160614 = split_part(pnt_id, ',', 76)::float,
d_20160625 = split_part(pnt_id, ',', 77)::float,
d_20160706 = split_part(pnt_id, ',', 78)::float,
d_20160717 = split_part(pnt_id, ',', 79)::float,
d_20160728 = split_part(pnt_id, ',', 80)::float,
d_20160808 = split_part(pnt_id, ',', 81)::float,
d_20160819 = split_part(pnt_id, ',', 82)::float,
d_20160830 = split_part(pnt_id, ',', 83)::float,
d_20160910 = split_part(pnt_id, ',', 84)::float,
d_20160921 = split_part(pnt_id, ',', 85)::float,
d_20161002 = split_part(pnt_id, ',', 86)::float,
d_20161013 = split_part(pnt_id, ',', 87)::float,
d_20161024 = split_part(pnt_id, ',', 88)::float,
d_20161104 = split_part(pnt_id, ',', 89)::float,
pnt_ds_nr_neighbors = split_part(pnt_id, ',', 90)::float
where length(pnt_id) > 15

alter table insar.insarlow_ps_dsc add column dumpid text
update insar.insarlow_ps_dsc set dumpid = pnt_id

update insar.insarlow_ps_dsc set
pnt_id = split_part(dumpid, ',', 1)
where length(dumpid) > 15

-- now also manually update the common.location table
select shortname,split_part("name", ',', 1) as aname, split_part("name", ',', 4)::float as x ,split_part("name", ',', 5)::float as y from common.location where length("name") >  50
update common.location set
x = split_part(name, ',', 4)::float,
y = split_part(name, ',', 5)::float,
geom = st_setsrid(st_point(split_part(name, ',', 4)::float,split_part(name, ',', 5)::float),28992)
where length(name) > 50

update common.location set
shortname = "name"
where length(name) > 50

update common.location set
"name" = split_part(shortname, ',', 1)
where length(name) > 50

update common.location set
shortname = Null
where length(shortname) > 50
