My question is similar to Creating geometry from lat/lon in table using PostGIS? , but I need to convert set or array of LON & LAT in PostgreSQL into geometry value.
For example, I can convert single LON & LAT to geometry point using below code (using PostgreSQL command) :
SET geometry = ST_GeomFromText('POINT(' || lon || ' ' || lat || ')',4326);
What if I have array of LON & LAT like this lon1,lon2,lon3,lat1,lat2,lat3
and I want to combine those coordinates to geometry values which will produce a long polygon shape instead of a single point shape?