[GIS] UpdateGeometrySRID and ST_Transform are the same thing

postgispostgis-2.0

UpdateGeometrySRID actually transforms the coordinate system of my data?
For in the PostGIS documentation it appears the trim ST_Transform (Returns a new geometry with its coordinates transformed to the SRID referenced by the integer parameter.).
What is the difference between these functions?

Another thing the sql below really redesigns same data? So no need to use UpdateGeometrySRID

ALTER TABLE lotacao ALTER COLUMN geom TYPE geometry (MULTILINESTRING, 101020) USING ST_Transform (ST_SetSRID(geom, 101010), 101020);

Best Answer

UpdateGeometrySRID is only changing the SRID in all necessary places taking care of the triggers. Use case is that user has imported data with wrong SRID code and wants to correct it without making a new import. Function does not reproject the data like ST_Transform does and coordinate values will remain the same after UpdateGeometrySRID.

For the second question, you can trust the PostGIS documantation http://postgis.net/docs/UpdateGeometrySRID.html. You can read that UpdateGeometrySRID is only a more handy way to do

ALTER TABLE roads 
  ALTER COLUMN geom TYPE geometry(MULTILINESTRING, 4326) 
    USING ST_SetSRID(geom,4326);

If you look at the SQL with ST_Transform you can see that it also contains that same ST_SetSRID stuff which means that it runs also UpdateGeometrySRID but by using the longer syntax.