BUG #4647: Geometric functions reorder their parameters randomly

From: "Juho Saarikko" <juho(dot)saarikko(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #4647: Geometric functions reorder their parameters randomly
Date: 2009-02-12 07:51:11
Message-ID: 200902120751.n1C7pB44026081@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 4647
Logged by: Juho Saarikko
Email address: juho(dot)saarikko(at)gmail(dot)com
PostgreSQL version: 8.3.6
Operating system: Linux
Description: Geometric functions reorder their parameters randomly
Details:

According to the online documentation, the ## operator is supposed to return
"Closest point to first operand on second operand". However, in reality it
seems to decide reorder its parameters as a function of them. That is,
sometimes it returns a point on the first operand, and sometimes a point on
the second operand, depending on what those operands are, but seemingly
consistently for a given set of operands.

This behaviour is also present in 8.3.5.

PostgreSQL output (from psql) demonstrating this behaviour:
**************************************

test=# select lseg '((1,1),(1,0))' ## box '((-2,-2),(-4,-4))';
?column?
----------
(1,0)
(1 row)

test=# select lseg '((0,1),(1,0))' ## box '((-2,-2),(-4,-4))';
?column?
----------
(-2,-2)
(1 row)

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Swadesh 2009-02-12 08:02:30 BackUp Problem : PG_graph table - Access Error
Previous Message Jason 2009-02-12 00:48:25 BUG #4646: Default password is patently absurd