Get Lon Lat values from a GEOGRAPHY data type in PostGIS
The ST_X(point) function only supports the geometry (as for now).
One workaround is to cast the geog to geom using ::geometry
.
Hense your query should be like this:
SELECT id, geog, ST_X(geog::geometry), ST_Y(geog::geometry) FROM locations;
And since it's geog the SRID would be 4326.
Also here's a good source for the geog type.