x und y - Werte bei point Datentyp?

Ich möchte in einer Datenbankanwendung die Entfernung von zwei Punkten berechnen. Die Punkte sind GPS-Koordinaten und als point Datentyp abgespeichert.
Für die Berechnung der Entfernung in km muss ich aber mit den einzelnen Werten (x,y) der Punkte rechnen.

Gibt es eine Möglichkeit, die Koordinatenanteile eine Punktes point(x,y) einzeln zu erhalten, ohne den Punkt vorher in eine Zeichenkette zu konvertieren und mit Stringoperationen das rauszufieseln?

Und ja, ich weiß, dass dafür PostGIS ideal wäre :astonished:

Ich mach mal Doku-Vorlese-Service: It is possible to access the two component numbers of a point as though the point were an array with indexes 0 and 1. For example, if t.p is a point column then SELECT p[0] FROM t retrieves the X coordinate and UPDATE t SET p[1] = … changes the Y coordinate. In the same way, a value of type box or lseg can be treated as an array of two point values.

Und ja, ich weiß, dass dafür PostGIS ideal wäre > :astonished:

Allerdings.

Wald -> Bäume :wink:

Danke!