request error on postgreSQL using postgis (more than one row returned) -


i have column containing 37 000 city of country on postgresql using postgis , i'm trying put point (geometry column) postgis function st_point(long, lat). have different long , lat data.

here request :

update city set geom_city = (select st_setsrid(st_point(city.city_long, city.city_lat),4326) city); 

problem i've error msg saying : more 1 row returned subquery used expression postgresql

i found out on stackoverflow needed pu "limit 1" @ end of request :

update city set geom_city = (select st_setsrid(st_point(city.city_long, city.city_lat),4326) city limit 1); 

which make request working write in geom_city column same result city.

anyone knows ?

the nested select subquery not needed, try this:

update city set geom_city = st_setsrid(st_point(city_long, city_lat),4326) ; 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -