[postgis-users] pl/pgsql getting ST_X output as REAL

Ralf Suhr Ralf.Suhr at itc-halle.de
Tue Oct 5 23:58:58 PDT 2010


Hi Jan,

ST_X is a function returning double precision. psql -d your_db -c "\df ST_X" 
can guide you.

Gr
Ralf

Am Dienstag 05 Oktober 2010 16:12:29 schrieb Jan Saalbach:
> Hi all,
> on my journey to learning PostgreSQL and PostGis I am now trying to
> write a function in pl/pgsql. In this little program I would like to
> determine the frequency of different x-values of POINT3D objects to
> get an idea about how many "rows" were digitized.
> 
> Therefore I would like to use the following command:
> 
> FOR x_value IN SELECT ST_X(points) FROM table LOOP
> 
> The problem is that in the DECLARE-section x_value has to be set to
> type RECORD.
> 
> x_value RECORD;
> 
> In the course of the program I would like to work with REAL values for
> convenience. How do I go about casting the x_value RECORD, which seems
> to be some kind of string with brackets around the value, to a REAL
> object? Any ideas?
> 
> Regards
> Jan
> 
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 



More information about the postgis-users mailing list