Remove ill-considered (not to mention undocumented) attempt to make
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 14 Sep 2007 03:25:31 +0000 (03:25 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 14 Sep 2007 03:25:31 +0000 (03:25 +0000)
contrib/intarray's GIN opclass override the built-in default.  Per bug #3048
and other complaints.

contrib/intarray/README.intarray
contrib/intarray/_int.sql.in
contrib/intarray/expected/_int.out
contrib/intarray/sql/_int.sql
contrib/intarray/uninstall__int.sql

index fd5fc8b685a6322f31be1c076f13215443fdbd63..9f16ca53eccfac09afe84e59bd246727507febd5 100644 (file)
@@ -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 (teodor@stack.net) and Oleg Bartunov
 (oleg@sai.msu.su). See http://www.sai.msu.su/~megera/postgres/gist
index 44efc857002e8da86713e7ea83e7123d8d020df8..ee77e784b7ac0177cbb956253c240a2835fe6fec 100644 (file)
@@ -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,
index 140aa20a172c2d9df8d106c70bf2639d8e14f529..596439d3149dca3687605ccd3ce4715bd93cd057 100644 (file)
@@ -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 
 -------
index 481754057e49e2e46f4bc8a450316b022cb2206c..1588e3b5145e2b65bd09ec34775c02dcbf6747b2 100644 (file)
@@ -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';
index 2f3b20fda0302dc52ce5d9f474f843f9054d98be..cc3d44273acb9247813c77dc6fc43ef762d5cea8 100644 (file)
@@ -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';