Using PostGIS to compute graph data I have a query which return me two dimension data:

SELECT POINT(value , extract(EPOCH FROM datetime)) AS pseudo_geom
FROM table


gaves me

pseudo_geom
---------------
(18,1439679940)
(29,1439680000)
(16,1439680060)


What I would like to do is to convert these data into a path type to be able to simplificate through ST_Simplify which accept a geometry type.

My goal is actually to reduce the number of points to display on a graph.

I tried with the path function and playing around with point(), string_agg() and grouping my data, with no result...

What could be the easiest and shortest way to do this?
I finally solved this using this scheme (not as simple as firstly expected):

SELECT ST_X(geom) as value, ST_Y(geom) as datetime from (
    select (ST_DumpPoints(simplifiedLine)).* as g1 from (
        SELECT ST_Simplify(ST_MakeLine(the_geom.resulted), 15) as simplifiedLine FROM (
            SELECT ST_MakePoint(value, extract(EPOCH FROM datetime)) as resulted FROM table 
            ORDER BY datetime ASC
        ) as the_geom
    ) as g   
) as pt


Hope that will help others.