Re: Wrong result of <select distinct geometry from XXX>

From: Peter Geoghegan <pg(at)heroku(dot)com>
To: yuanrui <yuanrui(at)pset(dot)suntec(dot)net>
Cc: pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Wrong result of <select distinct geometry from XXX>
Date: 2016-04-06 20:22:24
Message-ID: CAM3SWZTngDW5zRTZvXnyGiQ_BV06sRZbxSSwmDTswx9K+91EXQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Apr 5, 2016 at 11:04 PM, yuanrui <yuanrui(at)pset(dot)suntec(dot)net> wrote:
>
> Sorry to bother.
> I have encountered the following problem, please help me.
>
> The attached file is a backup file of two geometries, the table name is
> <temp_union_test>, the column of geometry is <the_geom>.
> when I execute < select distinct the_geom from temp_union_test >, there is
> only one row returned, but actually, the two geometries is totally
> different.

I think this might have something to do with weird legacy issues that
PostGIS has:

http://www.postgresql.org/message-id/etPan.559d8d4b.7c83e458.e975@Crane.local

This is basically a mistake that PostGIS made, but is now stuck with.

What does EXPLAIN show the plan as? Do you get a difference answer
when the plan is a hashAggregate instead of a unique + sort? You can
test this using "set enable_hashagg = off", or maybe "set enable_sort
= off" depending on the details (could be an index scan instead of a
sort for a unique node).

--
Peter Geoghegan

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message David Gould 2016-04-06 20:35:43 Re: PosgreSQL backend process crashed with signal 9
Previous Message Pavel Suderevsky 2016-04-06 18:22:23 Re: PosgreSQL backend process crashed with signal 9