'Postgresql issue: help needed

ALTER TABLE populated_places
ALTER COLUMN geom TYPE geography(Point, 4326) USING ST_Transform(geom, 4326)

says:

ERROR:  function st_transform(geography, integer) does not exist
LINE 4:  geom TYPE geography(Point, 4326) USING ST_Transform(geom, 4...                                                ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
SQL state: 42883
Character: 89


Solution 1:[1]

There is no variant of st_transform() in PostGIS that would take geography. All of them take geometry.

Applying that function to geography simply makes no sense.

Maybe you ran this ALTER TABLE command repeatedly by mistake? Because it would make sense on a geom column that's actually type geometry. Also, you might want to rename the column after converting it to geography ...

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1