Skip to main content
Returns the X coordinate of a point. For a GEOGRAPHY value, X is longitude in degrees under the OGC:CRS84 spherical contract. For a GEOMETRY value, X is returned in the units of its declared CRS and is not necessarily longitude. The value must be a non-empty POINT.

Syntax

Native overloads

Legacy overloads

The argument is a VARCHAR-encoded point from a constructor such as ST_Point.

Return value

Returns NULL when the input is NULL. For native GEOGRAPHY and GEOMETRY, an empty value or a non-POINT family produces an error. Native compute supports XY values with a valid descriptor.

Examples

Native examples

Legacy example

keyword

ST_X,ST,X GEOGRAPHY, GEOMETRY, VARCHAR, DOUBLE