-1
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
Erwin Brandstetter
  • 605,456
  • 145
  • 1,078
  • 1,228
  • 2
    All issues posted with the [tag:postgres] tag are "PostgreSQL issues". Don't repeat the obvious in the title. Also, *help is always needed*. Please use a descriptive title. And describe the problem in the body. – Erwin Brandstetter Apr 13 '22 at 02:48

1 Answers1

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 ...

Erwin Brandstetter
  • 605,456
  • 145
  • 1,078
  • 1,228
  • seems they are the same thing in binary. `select 'SRID=4326;POINT(-118.4079 33.9434)'::geography::text = 'SRID=4326;POINT(-118.4079 33.9434)'::geometry::text;` return true. .. – jian Apr 13 '22 at 15:17