Skip to main content
3 of 3
remove ref to documentation for addgeometrycolumn (not used in this answer)
anneb
  • 1.5k
  • 12
  • 13

Newer versions of PostGIS allow the following, slightly more common, syntax:

ALTER TABLE your_table ADD COLUMN geom geometry(Point, 4326);

Then use ST_SetSrid and ST_MakePoint to populate the column:

UPDATE your_table SET geom = ST_SetSRID(ST_MakePoint(longitude, latitude), 4326);

See documentation here:

anneb
  • 1.5k
  • 12
  • 13