summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2007-09-14 03:25:31 +0000
committerTom Lane2007-09-14 03:25:31 +0000
commit2d6cb170d4c5939950e8c25e08f554bdfd6050e4 (patch)
tree128c48fb413da45b30bb99439938b74d769c9be9
parentaa33bdd783f86ce9c552b66a08579b716a27bd6a (diff)
Remove ill-considered (not to mention undocumented) attempt to make
contrib/intarray's GIN opclass override the built-in default. Per bug #3048 and other complaints.
-rw-r--r--contrib/intarray/README.intarray5
-rw-r--r--contrib/intarray/_int.sql.in6
-rw-r--r--contrib/intarray/expected/_int.out2
-rw-r--r--contrib/intarray/sql/_int.sql2
-rw-r--r--contrib/intarray/uninstall__int.sql5
5 files changed, 6 insertions, 14 deletions
diff --git a/contrib/intarray/README.intarray b/contrib/intarray/README.intarray
index fd5fc8b685..9f16ca53ec 100644
--- a/contrib/intarray/README.intarray
+++ b/contrib/intarray/README.intarray
@@ -2,9 +2,10 @@ This is an implementation of RD-tree data structure using GiST interface
of PostgreSQL. It has built-in lossy compression.
Current implementation provides index support for one-dimensional array of
-int4's - gist__int_ops, suitable for small and medium size of arrays (used on
+integers: gist__int_ops, suitable for small and medium size of arrays (used by
default), and gist__intbig_ops for indexing large arrays (we use superimposed
-signature with length of 4096 bits to represent sets).
+signature with length of 4096 bits to represent sets). There is also a
+non-default gin__int_ops for GIN indexes on integer arrays.
All work was done by Teodor Sigaev ([email protected]) and Oleg Bartunov
([email protected]). See http://www.sai.msu.su/~megera/postgres/gist
diff --git a/contrib/intarray/_int.sql.in b/contrib/intarray/_int.sql.in
index 44efc85700..ee77e784b7 100644
--- a/contrib/intarray/_int.sql.in
+++ b/contrib/intarray/_int.sql.in
@@ -458,10 +458,6 @@ AS
STORAGE intbig_gkey;
--GIN
---mark built-in gin's _int4_ops as non default
-update pg_catalog.pg_opclass set opcdefault = 'f'
-where opcmethod = (select oid from pg_catalog.pg_am where amname='gin') and
- opcname = '_int4_ops';
CREATE FUNCTION ginint4_queryextract(internal, internal, int2)
RETURNS internal
@@ -474,7 +470,7 @@ AS 'MODULE_PATHNAME'
LANGUAGE C;
CREATE OPERATOR CLASS gin__int_ops
-DEFAULT FOR TYPE _int4 USING gin
+FOR TYPE _int4 USING gin
AS
OPERATOR 3 &&,
OPERATOR 6 = (anyarray, anyarray) RECHECK,
diff --git a/contrib/intarray/expected/_int.out b/contrib/intarray/expected/_int.out
index 140aa20a17..596439d314 100644
--- a/contrib/intarray/expected/_int.out
+++ b/contrib/intarray/expected/_int.out
@@ -516,7 +516,7 @@ SELECT count(*) from test__int WHERE a @@ '(20&23)|(50&68)';
(1 row)
DROP INDEX text_idx;
-CREATE INDEX text_idx on test__int using gin ( a );
+CREATE INDEX text_idx on test__int using gin ( a gin__int_ops );
SELECT count(*) from test__int WHERE a && '{23,50}';
count
-------
diff --git a/contrib/intarray/sql/_int.sql b/contrib/intarray/sql/_int.sql
index 481754057e..1588e3b514 100644
--- a/contrib/intarray/sql/_int.sql
+++ b/contrib/intarray/sql/_int.sql
@@ -111,7 +111,7 @@ SELECT count(*) from test__int WHERE a @> '{20,23}' or a @> '{50,68}';
SELECT count(*) from test__int WHERE a @@ '(20&23)|(50&68)';
DROP INDEX text_idx;
-CREATE INDEX text_idx on test__int using gin ( a );
+CREATE INDEX text_idx on test__int using gin ( a gin__int_ops );
SELECT count(*) from test__int WHERE a && '{23,50}';
SELECT count(*) from test__int WHERE a @@ '23|50';
diff --git a/contrib/intarray/uninstall__int.sql b/contrib/intarray/uninstall__int.sql
index 2f3b20fda0..cc3d44273a 100644
--- a/contrib/intarray/uninstall__int.sql
+++ b/contrib/intarray/uninstall__int.sql
@@ -123,8 +123,3 @@ DROP FUNCTION boolop(_int4, query_int);
DROP FUNCTION querytree(query_int);
DROP TYPE query_int CASCADE;
-
---mark built-in gin's _int4_ops as default again
-update pg_catalog.pg_opclass set opcdefault = 't'
-where opcmethod = (select oid from pg_catalog.pg_am where amname='gin') and
- opcname = '_int4_ops';