In the query below, why do we use As foo (geom)
and not As geom
? What does foo()
do?
SQL Query
SELECT ST_SRID(geom) AS srid, ST_SRID(ST_SetSRID(geom, 4326)) as srid_new
FROM (
VALUES (
ST_GeomFromText('POLYGON((70 20, 71 21, 71 19, 70 20))', 4269)),
(ST_Point(1,2)
)
) As foo (geom);
Using As geom
gives the error:
ERROR: function st_srid(record) does not exist
LINE 1: SELECT ST_SRID(geom) AS srid, ST_SRID(ST_SetSRID(geom, 4326)...