This topic describes the ST_X function. This function returns the x coordinate of a point object.

Syntax

float  ST_X(geometry  aPoint);

Parameters

Parameter Description
aPoint The point object that you want to specify.

Description

  • The object that you specify must be a point object.
  • If the object that you specify is unavailable or invalid, the ST_X function returns NULL.
  • The ST_X function supports 3D objects and does not delete z coordinates.

Examples

SELECT ST_X('POINT(0 1 2 3)'::geometry);
 st_x
------
    0
(1 row)