On Mon, 2007-28-05 at 15:05 -0400, Tom Lane wrote:
> Right.  I guess you misunderstood me: I was arguing for rejecting double
> occurrences of the same unit name, but not occurrences of different unit
> names that we happen to map into the same interval field internally.

Makes sense to me. I'll send  a patch for this shortly (but I'll commit
the patch for the usec/msec issue first -- this second change shouldn't
be backpatched).

> I forget --- are the tmask bits used in stored typmod values for
> intervals?  It'd probably be best not to change the meanings of typmod
> bits, since those are visible to client code if it wants to look.

According to datetime.h, only some of the tmask bits are used in stored
typmods: YEAR, MONTH, DAY, HOUR, MINUTE, and SECOND, and the patch
doesn't modify any of those. So I think we're okay.

> Hmmm ... if you check the cvs history for those tests you might find
> some evidence.

"Modify regression tests to allow GEQ optimizer (order results).",
according to the 1997 CVS commit from Thomas Lockhart that added the
lines in question. Presumably that is no longer relevant. Nothing
unexpected happens if the disabling of GEQO is removed, so I'll apply
the attached patch shortly barring any objections.

-Neil

Index: src/test/regress/expected/geometry.out
===================================================================
RCS file: /home/neilc/postgres/cvs_root/pgsql/src/test/regress/expected/geometry.out,v
retrieving revision 1.25
diff -p -c -r1.25 geometry.out
*** src/test/regress/expected/geometry.out	1 Feb 2007 19:10:30 -0000	1.25
--- src/test/regress/expected/geometry.out	29 May 2007 02:16:43 -0000
*************** SELECT '' AS twenty, b.f1 / p.f1 AS rota
*** 284,290 ****
  --
  -- Paths
  --
- SET geqo TO 'off';
  SELECT '' AS eight, npoints(f1) AS npoints, f1 AS path FROM PATH_TBL;
   eight | npoints |           path            
  -------+---------+---------------------------
--- 284,289 ----
*************** SELECT '' AS eight, p1.f1 * point '(2,-1
*** 337,343 ****
         | ((34,13),(40,15))
  (8 rows)
  
- RESET geqo;
  --
  -- Polygons
  --
--- 336,341 ----
Index: src/test/regress/expected/geometry_1.out
===================================================================
RCS file: /home/neilc/postgres/cvs_root/pgsql/src/test/regress/expected/geometry_1.out,v
retrieving revision 1.10
diff -p -c -r1.10 geometry_1.out
*** src/test/regress/expected/geometry_1.out	1 Feb 2007 20:11:18 -0000	1.10
--- src/test/regress/expected/geometry_1.out	29 May 2007 02:16:50 -0000
*************** SELECT '' AS twenty, b.f1 / p.f1 AS rota
*** 284,290 ****
  --
  -- Paths
  --
- SET geqo TO 'off';
  SELECT '' AS eight, npoints(f1) AS npoints, f1 AS path FROM PATH_TBL;
   eight | npoints |           path            
  -------+---------+---------------------------
--- 284,289 ----
*************** SELECT '' AS eight, p1.f1 * point '(2,-1
*** 337,343 ****
         | ((34,13),(40,15))
  (8 rows)
  
- RESET geqo;
  --
  -- Polygons
  --
--- 336,341 ----
Index: src/test/regress/expected/geometry_2.out
===================================================================
RCS file: /home/neilc/postgres/cvs_root/pgsql/src/test/regress/expected/geometry_2.out,v
retrieving revision 1.7
diff -p -c -r1.7 geometry_2.out
*** src/test/regress/expected/geometry_2.out	1 Feb 2007 20:11:18 -0000	1.7
--- src/test/regress/expected/geometry_2.out	29 May 2007 02:16:56 -0000
*************** SELECT '' AS twenty, b.f1 / p.f1 AS rota
*** 284,290 ****
  --
  -- Paths
  --
- SET geqo TO 'off';
  SELECT '' AS eight, npoints(f1) AS npoints, f1 AS path FROM PATH_TBL;
   eight | npoints |           path            
  -------+---------+---------------------------
--- 284,289 ----
*************** SELECT '' AS eight, p1.f1 * point '(2,-1
*** 337,343 ****
         | ((34,13),(40,15))
  (8 rows)
  
- RESET geqo;
  --
  -- Polygons
  --
--- 336,341 ----
Index: src/test/regress/expected/point.out
===================================================================
RCS file: /home/neilc/postgres/cvs_root/pgsql/src/test/regress/expected/point.out,v
retrieving revision 1.16
diff -p -c -r1.16 point.out
*** src/test/regress/expected/point.out	9 Jan 2007 02:14:16 -0000	1.16
--- src/test/regress/expected/point.out	29 May 2007 02:16:00 -0000
*************** SELECT '' AS six, p.f1, p.f1 <-> point '
*** 105,111 ****
       | (5.1,34.5) | 34.8749193547455
  (6 rows)
  
- SET geqo TO 'off';
  SELECT '' AS thirtysix, p1.f1 AS point1, p2.f1 AS point2, p1.f1 <-> p2.f1 AS dist
     FROM POINT_TBL p1, POINT_TBL p2
     ORDER BY dist, p1.f1[0], p2.f1[0];
--- 105,110 ----
*************** SELECT '' AS three, p1.f1 AS point1, p2.
*** 222,225 ****
         | (5.1,34.5) | (10,10)  | 24.9851956166046
  (3 rows)
  
- RESET geqo;
--- 221,223 ----
Index: src/test/regress/expected/tinterval.out
===================================================================
RCS file: /home/neilc/postgres/cvs_root/pgsql/src/test/regress/expected/tinterval.out,v
retrieving revision 1.12
diff -p -c -r1.12 tinterval.out
*** src/test/regress/expected/tinterval.out	7 Apr 2005 01:51:40 -0000	1.12
--- src/test/regress/expected/tinterval.out	29 May 2007 02:15:54 -0000
*************** SELECT '' AS three, t1.*
*** 103,109 ****
         | ["Wed Dec 31 16:00:00 1969 PST" "Mon May 01 00:30:30 1995 PDT"]
  (3 rows)
  
- SET geqo TO 'off';
  SELECT '' AS five, t1.f1, t2.f1
     FROM TINTERVAL_TBL t1, TINTERVAL_TBL t2
     WHERE t1.f1 && t2.f1 and
--- 103,108 ----
*************** SELECT '' AS three, t1.f1
*** 167,170 ****
         | ["Wed Dec 31 16:00:00 1969 PST" "Mon May 01 00:30:30 1995 PDT"]
  (3 rows)
  
- RESET geqo;
--- 166,168 ----
Index: src/test/regress/sql/geometry.sql
===================================================================
RCS file: /home/neilc/postgres/cvs_root/pgsql/src/test/regress/sql/geometry.sql,v
retrieving revision 1.10
diff -p -c -r1.10 geometry.sql
*** src/test/regress/sql/geometry.sql	9 Jan 2007 02:14:16 -0000	1.10
--- src/test/regress/sql/geometry.sql	29 May 2007 02:13:16 -0000
*************** SELECT '' AS twenty, b.f1 / p.f1 AS rota
*** 87,94 ****
  -- Paths
  --
  
- SET geqo TO 'off';
- 
  SELECT '' AS eight, npoints(f1) AS npoints, f1 AS path FROM PATH_TBL;
  
  SELECT '' AS four, path(f1) FROM POLYGON_TBL;
--- 87,92 ----
*************** SELECT '' AS eight, p1.f1 + point '(10,1
*** 101,108 ****
  SELECT '' AS eight, p1.f1 * point '(2,-1)' AS dist_mul
     FROM PATH_TBL p1;
  
- RESET geqo;
- 
  --
  -- Polygons
  --
--- 99,104 ----
Index: src/test/regress/sql/point.sql
===================================================================
RCS file: /home/neilc/postgres/cvs_root/pgsql/src/test/regress/sql/point.sql,v
retrieving revision 1.12
diff -p -c -r1.12 point.sql
*** src/test/regress/sql/point.sql	9 Jan 2007 02:14:16 -0000	1.12
--- src/test/regress/sql/point.sql	29 May 2007 02:13:28 -0000
*************** SELECT '' AS six, p.f1, p.f1 <-> point '
*** 55,62 ****
     FROM POINT_TBL p
     ORDER BY dist;
  
- SET geqo TO 'off';
- 
  SELECT '' AS thirtysix, p1.f1 AS point1, p2.f1 AS point2, p1.f1 <-> p2.f1 AS dist
     FROM POINT_TBL p1, POINT_TBL p2
     ORDER BY dist, p1.f1[0], p2.f1[0];
--- 55,60 ----
*************** SELECT '' AS three, p1.f1 AS point1, p2.
*** 76,81 ****
     FROM POINT_TBL p1, POINT_TBL p2 
     WHERE (p1.f1 <-> p2.f1) > 3 and p1.f1 << p2.f1 and p1.f1 >^ p2.f1
     ORDER BY distance;
- 
- RESET geqo;
- 
--- 74,76 ----
Index: src/test/regress/sql/tinterval.sql
===================================================================
RCS file: /home/neilc/postgres/cvs_root/pgsql/src/test/regress/sql/tinterval.sql,v
retrieving revision 1.7
diff -p -c -r1.7 tinterval.sql
*** src/test/regress/sql/tinterval.sql	7 Apr 2005 01:51:41 -0000	1.7
--- src/test/regress/sql/tinterval.sql	29 May 2007 02:12:50 -0000
*************** SELECT '' AS three, t1.*
*** 70,77 ****
     WHERE t1.f1 &&
          tinterval '["Aug 15 14:23:19 1983" "Sep 16 14:23:19 1983"]';
  
- SET geqo TO 'off';
- 
  SELECT '' AS five, t1.f1, t2.f1
     FROM TINTERVAL_TBL t1, TINTERVAL_TBL t2
     WHERE t1.f1 && t2.f1 and
--- 70,75 ----
*************** SELECT '' AS three, t1.f1
*** 97,101 ****
          (abstime 'Aug 15 14:23:19 1983' <#>
           abstime 'Sep 16 14:23:19 1983')
     ORDER BY t1.f1;
- 
- RESET geqo;
--- 95,97 ----
---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Reply via email to