A polygon does not have a single X coordinate and a single Y coordinate. A polygon is an accumulation of vertices with an X and Y coordinate.
You can use the ST_AsText
function to get the WKT representation of your geometry :
SELECT ST_AsText(geom)
FROM polygon -- change the name of your table
-- Result example :
-- POLYGON((-0.606871159358866 44.8533728143996,-0.607088886443168 44.8527320746944,-0.606672094596075 44.8527569577897,-0.606441925964099 44.8531177626723,-0.606441925964099 44.8531986327321,-0.606871159358866 44.8533728143996))
To get a single X and Y coordinate, you can use the centroid of the polygon.
WITH centro AS (SELECT ST_Centroid(geom) as geom FROM test_poly)
SELECT ST_X(geom) as X, ST_Y(geom)
FROM centro
geometry
is not a point - seems clear enough