![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Is there a way to do a SELECT DISTINCT on boxes: test=> create TABLE t3 (a box); CREATE TABLE test=> insert into t3 values ('(2,2),(1,1)'); INSERT 17232 1 test=> insert into t3 values ('(2,2),(1,1)'); INSERT 17233 1 test=> insert into t3 values ('(3,3),(2,2)'); INSERT 17234 1 test=> insert into t3 values ('(3,3),(2,2)'); INSERT 17235 1 test=> select distinct * from t3; ERROR: could not identify an ordering operator for type box HINT: Use an explicit ordering operator or modify the query. I tried doing subqueries and using oids but that didn't help. I don't understand why this doesn't work: SELECT a FROM t3 t2 WHERE t2.oid = (SELECT MIN(t.oid) FROM t3 t WHERE t2.a = t.a); a ------------- (2,2),(1,1) (1 row) If finds only the duplicate. |
#3
| |||
| |||
|
|
I found the cause. Equals for boxes compares only area, \do: |
#4
| |||
| |||
|
|
Bruce Momjian <pgman (AT) candle (DOT) pha.pa.us> writes: I found the cause. Equals for boxes compares only area, \do: ... which is in itself pretty bogus IMHO. There are a couple of the geometric types for which '=' does not do what you'd really expect. I've been wondering if we could get away with changing this ... |
#5
| |||
| |||
|
|
Bruce Momjian <pgman (AT) candle (DOT) pha.pa.us> writes: I found the cause. Equals for boxes compares only area, \do: ... which is in itself pretty bogus IMHO. There are a couple of the geometric types for which '=' does not do what you'd really expect. I've been wondering if we could get away with changing this ... regards, tom lane |
![]() |
| Thread Tools | |
| Display Modes | |
| |