BUG #12877: Altitude not respected in order by and group by - Mailing list pgsql-bugs

From m8r-444fqh@mailinator.com
Subject BUG #12877: Altitude not respected in order by and group by
Date
Msg-id 20150318152716.2739.45328@wrigleys.postgresql.org
Whole thread Raw
Responses Re: BUG #12877: Altitude not respected in order by and group by  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      12877
Logged by:          m8r-444fqh
Email address:      m8r-444fqh@mailinator.com
PostgreSQL version: 9.3.4
Operating system:   centos
Description:

-- "PostgreSQL 9.3.4 on x86_64-unknown-linux-gnu, compiled by gcc (GCC)
4.4.7 20120313 (Red Hat 4.4.7-4), 64-bit"
-- Postgis: "2.1 USE_GEOS=1 USE_PROJ=1 USE_STATS=1"

create table v001 ( edge bigint, vertex geometry(PointZ,4326) );

insert into v001 values
( 19757751000,st_geomfromtext('POINT Z (-87.63394 41.8868 0)',4326)),
( 19757752000,st_geomfromtext('POINT Z (-87.63394 41.8868 0)',4326)),
( 19757763000,st_geomfromtext('POINT Z (-87.63394 41.8868 0)',4326)),
( 19791042000,st_geomfromtext('POINT Z (-87.63394 41.8868 -1)',4326)),
( 721078263000,st_geomfromtext('POINT Z (-87.63394 41.8868 0)',4326)),
( 721078269000,st_geomfromtext('POINT Z (-87.63394 41.8868 -1)',4326));

-- 1.Query, fails to sort altitude:
select edge, st_astext( vertex ) from v001
 order by vertex,edge;

-- 1.Results:
-- 19757751000;"POINT Z (-87.63394 41.8868 0)"
-- 19757752000;"POINT Z (-87.63394 41.8868 0)"
-- 19757763000;"POINT Z (-87.63394 41.8868 0)"
-- 19791042000;"POINT Z (-87.63394 41.8868 -1)"
-- 721078263000;"POINT Z (-87.63394 41.8868 0)"
-- 721078269000;"POINT Z (-87.63394 41.8868 -1)"

-- 2.Query, fails to respect altitude:
select array_agg( edge ) as edges, st_astext(vertex) from v001
group by vertex;

-- 2.Results:
--
"{19757751000,19757752000,19757763000,19791042000,721078263000,721078269000}";"POINT
Z (-87.63394 41.8868 0)"

pgsql-bugs by date:

Previous
From: Ján Máté
Date:
Subject: Re: BUG #12872: Inconsistent processing of interval values
Next
From: Tom Lane
Date:
Subject: Re: BUG #12877: Altitude not respected in order by and group by