summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane2005-07-01 19:19:05 +0000
committerTom Lane2005-07-01 19:19:05 +0000
commite7e1694295e3d867f07afedf6505d0e0436cb67e (patch)
treebdda7cd092d1c73d0d53820c2a93dd8c2faa4210 /src/include
parent875efad48170fa9c6ffde98cf8a235470726c692 (diff)
Migrate rtree_gist functionality into the core system, and add some
basic regression tests for GiST to the standard regression tests. I took the opportunity to add an rtree-equivalent gist opclass for circles; the contrib version only covered boxes and polygons, but indexing circles is very handy for distance searches.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/catalog/catversion.h4
-rw-r--r--src/include/catalog/pg_amop.h53
-rw-r--r--src/include/catalog/pg_amproc.h26
-rw-r--r--src/include/catalog/pg_opclass.h5
-rw-r--r--src/include/catalog/pg_operator.h8
-rw-r--r--src/include/catalog/pg_proc.h30
-rw-r--r--src/include/utils/geo_decls.h19
7 files changed, 134 insertions, 11 deletions
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h
index 5a1943723dc..a465037e4b3 100644
--- a/src/include/catalog/catversion.h
+++ b/src/include/catalog/catversion.h
@@ -37,7 +37,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.283 2005/06/28 05:09:04 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.284 2005/07/01 19:19:02 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -53,6 +53,6 @@
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 200506272
+#define CATALOG_VERSION_NO 200507011
#endif
diff --git a/src/include/catalog/pg_amop.h b/src/include/catalog/pg_amop.h
index e318898f4f6..35589750d16 100644
--- a/src/include/catalog/pg_amop.h
+++ b/src/include/catalog/pg_amop.h
@@ -23,7 +23,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/pg_amop.h,v 1.64 2005/06/24 20:53:31 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_amop.h,v 1.65 2005/07/01 19:19:03 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
@@ -619,4 +619,55 @@ DATA(insert ( 2232 0 1 f 2334 ));
/* aclitem_ops */
DATA(insert ( 2235 0 1 f 974 ));
+/*
+ * gist box_ops
+ */
+
+DATA(insert ( 2593 0 1 f 493 ));
+DATA(insert ( 2593 0 2 f 494 ));
+DATA(insert ( 2593 0 3 f 500 ));
+DATA(insert ( 2593 0 4 f 495 ));
+DATA(insert ( 2593 0 5 f 496 ));
+DATA(insert ( 2593 0 6 f 499 ));
+DATA(insert ( 2593 0 7 f 498 ));
+DATA(insert ( 2593 0 8 f 497 ));
+DATA(insert ( 2593 0 9 f 2571 ));
+DATA(insert ( 2593 0 10 f 2570 ));
+DATA(insert ( 2593 0 11 f 2573 ));
+DATA(insert ( 2593 0 12 f 2572 ));
+
+/*
+ * gist poly_ops (supports polygons)
+ */
+
+DATA(insert ( 2594 0 1 t 485 ));
+DATA(insert ( 2594 0 2 t 486 ));
+DATA(insert ( 2594 0 3 t 492 ));
+DATA(insert ( 2594 0 4 t 487 ));
+DATA(insert ( 2594 0 5 t 488 ));
+DATA(insert ( 2594 0 6 t 491 ));
+DATA(insert ( 2594 0 7 t 490 ));
+DATA(insert ( 2594 0 8 t 489 ));
+DATA(insert ( 2594 0 9 t 2575 ));
+DATA(insert ( 2594 0 10 t 2574 ));
+DATA(insert ( 2594 0 11 t 2577 ));
+DATA(insert ( 2594 0 12 t 2576 ));
+
+/*
+ * gist circle_ops
+ */
+
+DATA(insert ( 2595 0 1 t 1506 ));
+DATA(insert ( 2595 0 2 t 1507 ));
+DATA(insert ( 2595 0 3 t 1513 ));
+DATA(insert ( 2595 0 4 t 1508 ));
+DATA(insert ( 2595 0 5 t 1509 ));
+DATA(insert ( 2595 0 6 t 1512 ));
+DATA(insert ( 2595 0 7 t 1511 ));
+DATA(insert ( 2595 0 8 t 1510 ));
+DATA(insert ( 2595 0 9 t 2589 ));
+DATA(insert ( 2595 0 10 t 1515 ));
+DATA(insert ( 2595 0 11 t 1514 ));
+DATA(insert ( 2595 0 12 t 2590 ));
+
#endif /* PG_AMOP_H */
diff --git a/src/include/catalog/pg_amproc.h b/src/include/catalog/pg_amproc.h
index f9eb419a169..38c4f257837 100644
--- a/src/include/catalog/pg_amproc.h
+++ b/src/include/catalog/pg_amproc.h
@@ -19,7 +19,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/pg_amproc.h,v 1.53 2005/04/14 01:38:20 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_amproc.h,v 1.54 2005/07/01 19:19:03 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
@@ -170,4 +170,28 @@ DATA(insert ( 2231 0 1 456 ));
DATA(insert ( 2232 0 1 455 ));
DATA(insert ( 2235 0 1 329 ));
+
+/* gist */
+DATA(insert ( 2593 0 1 2578 ));
+DATA(insert ( 2593 0 2 2583 ));
+DATA(insert ( 2593 0 3 2579 ));
+DATA(insert ( 2593 0 4 2580 ));
+DATA(insert ( 2593 0 5 2581 ));
+DATA(insert ( 2593 0 6 2582 ));
+DATA(insert ( 2593 0 7 2584 ));
+DATA(insert ( 2594 0 1 2585 ));
+DATA(insert ( 2594 0 2 2583 ));
+DATA(insert ( 2594 0 3 2586 ));
+DATA(insert ( 2594 0 4 2580 ));
+DATA(insert ( 2594 0 5 2581 ));
+DATA(insert ( 2594 0 6 2582 ));
+DATA(insert ( 2594 0 7 2584 ));
+DATA(insert ( 2595 0 1 2591 ));
+DATA(insert ( 2595 0 2 2583 ));
+DATA(insert ( 2595 0 3 2592 ));
+DATA(insert ( 2595 0 4 2580 ));
+DATA(insert ( 2595 0 5 2581 ));
+DATA(insert ( 2595 0 6 2582 ));
+DATA(insert ( 2595 0 7 2584 ));
+
#endif /* PG_AMPROC_H */
diff --git a/src/include/catalog/pg_opclass.h b/src/include/catalog/pg_opclass.h
index 23485ff0ebb..24b4059a831 100644
--- a/src/include/catalog/pg_opclass.h
+++ b/src/include/catalog/pg_opclass.h
@@ -27,7 +27,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/pg_opclass.h,v 1.65 2005/06/28 05:09:07 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_opclass.h,v 1.66 2005/07/01 19:19:03 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
@@ -175,5 +175,8 @@ DATA(insert OID = 2232 ( 405 name_pattern_ops PGNSP PGUID 19 f 0 ));
DATA(insert OID = 2233 ( 403 reltime_ops PGNSP PGUID 703 t 0 ));
DATA(insert OID = 2234 ( 403 tinterval_ops PGNSP PGUID 704 t 0 ));
DATA(insert OID = 2235 ( 405 aclitem_ops PGNSP PGUID 1033 t 0 ));
+DATA(insert OID = 2593 ( 783 box_ops PGNSP PGUID 603 t 0 ));
+DATA(insert OID = 2594 ( 783 poly_ops PGNSP PGUID 604 t 603 ));
+DATA(insert OID = 2595 ( 783 circle_ops PGNSP PGUID 718 t 603 ));
#endif /* PG_OPCLASS_H */
diff --git a/src/include/catalog/pg_operator.h b/src/include/catalog/pg_operator.h
index 9de43736eae..ef04e960a79 100644
--- a/src/include/catalog/pg_operator.h
+++ b/src/include/catalog/pg_operator.h
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/pg_operator.h,v 1.135 2005/06/28 05:09:07 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_operator.h,v 1.136 2005/07/01 19:19:03 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
@@ -568,8 +568,8 @@ DATA(insert OID = 1510 ( "@" PGNSP PGUID b f 718 718 16 1511 0 0 0 0 0
DATA(insert OID = 1511 ( "~" PGNSP PGUID b f 718 718 16 1510 0 0 0 0 0 circle_contain contsel contjoinsel ));
DATA(insert OID = 1512 ( "~=" PGNSP PGUID b f 718 718 16 1512 0 0 0 0 0 circle_same eqsel eqjoinsel ));
DATA(insert OID = 1513 ( "&&" PGNSP PGUID b f 718 718 16 1513 0 0 0 0 0 circle_overlap areasel areajoinsel ));
-DATA(insert OID = 1514 ( ">^" PGNSP PGUID b f 718 718 16 0 0 0 0 0 0 circle_above positionsel positionjoinsel ));
-DATA(insert OID = 1515 ( "<^" PGNSP PGUID b f 718 718 16 0 0 0 0 0 0 circle_below positionsel positionjoinsel ));
+DATA(insert OID = 1514 ( "|>>" PGNSP PGUID b f 718 718 16 0 0 0 0 0 0 circle_above positionsel positionjoinsel ));
+DATA(insert OID = 1515 ( "<<|" PGNSP PGUID b f 718 718 16 0 0 0 0 0 0 circle_below positionsel positionjoinsel ));
DATA(insert OID = 1516 ( "+" PGNSP PGUID b f 718 600 718 0 0 0 0 0 0 circle_add_pt - - ));
DATA(insert OID = 1517 ( "-" PGNSP PGUID b f 718 600 718 0 0 0 0 0 0 circle_sub_pt - - ));
@@ -874,6 +874,8 @@ DATA(insert OID = 2574 ( "<<|" PGNSP PGUID b f 604 604 16 0 0 0 0 0 0
DATA(insert OID = 2575 ( "&<|" PGNSP PGUID b f 604 604 16 0 0 0 0 0 0 poly_overbelow positionsel positionjoinsel ));
DATA(insert OID = 2576 ( "|&>" PGNSP PGUID b f 604 604 16 0 0 0 0 0 0 poly_overabove positionsel positionjoinsel ));
DATA(insert OID = 2577 ( "|>>" PGNSP PGUID b f 604 604 16 0 0 0 0 0 0 poly_above positionsel positionjoinsel ));
+DATA(insert OID = 2589 ( "&<|" PGNSP PGUID b f 718 718 16 0 0 0 0 0 0 circle_overbelow positionsel positionjoinsel ));
+DATA(insert OID = 2590 ( "|&>" PGNSP PGUID b f 718 718 16 0 0 0 0 0 0 circle_overabove positionsel positionjoinsel ));
/*
diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h
index 5326a770592..340052792f7 100644
--- a/src/include/catalog/pg_proc.h
+++ b/src/include/catalog/pg_proc.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.372 2005/06/28 05:09:09 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.373 2005/07/01 19:19:03 tgl Exp $
*
* NOTES
* The script catalog/genbki.sh reads this file and generates .bki
@@ -3675,6 +3675,34 @@ DATA(insert OID = 2568 ( poly_overabove PGNSP PGUID 12 f f t f i 2 16 "604 60
DESCR("overlaps or is above");
DATA(insert OID = 2569 ( poly_above PGNSP PGUID 12 f f t f i 2 16 "604 604" _null_ _null_ _null_ poly_above - _null_ ));
DESCR("is above");
+DATA(insert OID = 2587 ( circle_overbelow PGNSP PGUID 12 f f t f i 2 16 "718 718" _null_ _null_ _null_ circle_overbelow - _null_ ));
+DESCR("overlaps or is below");
+DATA(insert OID = 2588 ( circle_overabove PGNSP PGUID 12 f f t f i 2 16 "718 718" _null_ _null_ _null_ circle_overabove - _null_ ));
+DESCR("overlaps or is above");
+
+/* support functions for GiST r-tree emulation */
+DATA(insert OID = 2578 ( gist_box_consistent PGNSP PGUID 12 f f t f i 3 16 "2281 603 23" _null_ _null_ _null_ gist_box_consistent - _null_ ));
+DESCR("GiST support");
+DATA(insert OID = 2579 ( gist_box_compress PGNSP PGUID 12 f f t f i 1 2281 "2281" _null_ _null_ _null_ gist_box_compress - _null_ ));
+DESCR("GiST support");
+DATA(insert OID = 2580 ( gist_box_decompress PGNSP PGUID 12 f f t f i 1 2281 "2281" _null_ _null_ _null_ gist_box_decompress - _null_ ));
+DESCR("GiST support");
+DATA(insert OID = 2581 ( gist_box_penalty PGNSP PGUID 12 f f t f i 3 2281 "2281 2281 2281" _null_ _null_ _null_ gist_box_penalty - _null_ ));
+DESCR("GiST support");
+DATA(insert OID = 2582 ( gist_box_picksplit PGNSP PGUID 12 f f t f i 2 2281 "2281 2281" _null_ _null_ _null_ gist_box_picksplit - _null_ ));
+DESCR("GiST support");
+DATA(insert OID = 2583 ( gist_box_union PGNSP PGUID 12 f f t f i 2 603 "2281 2281" _null_ _null_ _null_ gist_box_union - _null_ ));
+DESCR("GiST support");
+DATA(insert OID = 2584 ( gist_box_same PGNSP PGUID 12 f f t f i 3 2281 "603 603 2281" _null_ _null_ _null_ gist_box_same - _null_ ));
+DESCR("GiST support");
+DATA(insert OID = 2585 ( gist_poly_consistent PGNSP PGUID 12 f f t f i 3 16 "2281 604 23" _null_ _null_ _null_ gist_poly_consistent - _null_ ));
+DESCR("GiST support");
+DATA(insert OID = 2586 ( gist_poly_compress PGNSP PGUID 12 f f t f i 1 2281 "2281" _null_ _null_ _null_ gist_poly_compress - _null_ ));
+DESCR("GiST support");
+DATA(insert OID = 2591 ( gist_circle_consistent PGNSP PGUID 12 f f t f i 3 16 "2281 718 23" _null_ _null_ _null_ gist_circle_consistent - _null_ ));
+DESCR("GiST support");
+DATA(insert OID = 2592 ( gist_circle_compress PGNSP PGUID 12 f f t f i 1 2281 "2281" _null_ _null_ _null_ gist_circle_compress - _null_ ));
+DESCR("GiST support");
/*
diff --git a/src/include/utils/geo_decls.h b/src/include/utils/geo_decls.h
index 9bf7ce08998..1795a9f14a0 100644
--- a/src/include/utils/geo_decls.h
+++ b/src/include/utils/geo_decls.h
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/utils/geo_decls.h,v 1.47 2005/06/24 20:53:33 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/utils/geo_decls.h,v 1.48 2005/07/01 19:19:04 tgl Exp $
*
* NOTE
* These routines do *not* use the float types from adt/.
@@ -379,6 +379,8 @@ extern Datum circle_contained(PG_FUNCTION_ARGS);
extern Datum circle_contain(PG_FUNCTION_ARGS);
extern Datum circle_below(PG_FUNCTION_ARGS);
extern Datum circle_above(PG_FUNCTION_ARGS);
+extern Datum circle_overbelow(PG_FUNCTION_ARGS);
+extern Datum circle_overabove(PG_FUNCTION_ARGS);
extern Datum circle_eq(PG_FUNCTION_ARGS);
extern Datum circle_ne(PG_FUNCTION_ARGS);
extern Datum circle_lt(PG_FUNCTION_ARGS);
@@ -404,7 +406,7 @@ extern Datum poly_circle(PG_FUNCTION_ARGS);
extern Datum circle_poly(PG_FUNCTION_ARGS);
extern Datum circle_area(PG_FUNCTION_ARGS);
-/* support routines for the rtree access method (rtproc.c) */
+/* support routines for the rtree access method (access/rtree/rtproc.c) */
extern Datum rt_box_union(PG_FUNCTION_ARGS);
extern Datum rt_box_inter(PG_FUNCTION_ARGS);
extern Datum rt_box_size(PG_FUNCTION_ARGS);
@@ -412,6 +414,19 @@ extern Datum rt_poly_size(PG_FUNCTION_ARGS);
extern Datum rt_poly_union(PG_FUNCTION_ARGS);
extern Datum rt_poly_inter(PG_FUNCTION_ARGS);
+/* support routines for the GiST access method (access/gist/gistproc.c) */
+extern Datum gist_box_compress(PG_FUNCTION_ARGS);
+extern Datum gist_box_decompress(PG_FUNCTION_ARGS);
+extern Datum gist_box_union(PG_FUNCTION_ARGS);
+extern Datum gist_box_picksplit(PG_FUNCTION_ARGS);
+extern Datum gist_box_consistent(PG_FUNCTION_ARGS);
+extern Datum gist_box_penalty(PG_FUNCTION_ARGS);
+extern Datum gist_box_same(PG_FUNCTION_ARGS);
+extern Datum gist_poly_compress(PG_FUNCTION_ARGS);
+extern Datum gist_poly_consistent(PG_FUNCTION_ARGS);
+extern Datum gist_circle_compress(PG_FUNCTION_ARGS);
+extern Datum gist_circle_consistent(PG_FUNCTION_ARGS);
+
/* geo_selfuncs.c */
extern Datum areasel(PG_FUNCTION_ARGS);
extern Datum areajoinsel(PG_FUNCTION_ARGS);