Sep 21, 2017

Creating a shape file of points from lat long data in postgres sql postgis

MyTable has fields like slno,longitude,latitude
We have to combine longitude,latitude and make another field say 'geom' of type 'public.geometry'
in order to do that first create field 'geom' and execute the following statement.

UPDATE MyTable
SET geom = (SELECT ST_GeomFromText('POINT('||longitude||' '||latitude||')'))

Now that you have PSQL table Open it in QGIS software as vector layerand save as .shape file.