Skip to content

Commit 2d6cb17

Browse files
committed
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.
1 parent aa33bdd commit 2d6cb17

File tree

5 files changed

+6
-14
lines changed

5 files changed

+6
-14
lines changed

contrib/intarray/README.intarray

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ This is an implementation of RD-tree data structure using GiST interface
22
of PostgreSQL. It has built-in lossy compression.
33

44
Current implementation provides index support for one-dimensional array of
5-
int4's - gist__int_ops, suitable for small and medium size of arrays (used on
5+
integers: gist__int_ops, suitable for small and medium size of arrays (used by
66
default), and gist__intbig_ops for indexing large arrays (we use superimposed
7-
signature with length of 4096 bits to represent sets).
7+
signature with length of 4096 bits to represent sets). There is also a
8+
non-default gin__int_ops for GIN indexes on integer arrays.
89

910
All work was done by Teodor Sigaev (teodor@stack.net) and Oleg Bartunov
1011
(oleg@sai.msu.su). See http://www.sai.msu.su/~megera/postgres/gist

contrib/intarray/_int.sql.in

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -458,10 +458,6 @@ AS
458458
STORAGE intbig_gkey;
459459

460460
--GIN
461-
--mark built-in gin's _int4_ops as non default
462-
update pg_catalog.pg_opclass set opcdefault = 'f'
463-
where opcmethod = (select oid from pg_catalog.pg_am where amname='gin') and
464-
opcname = '_int4_ops';
465461

466462
CREATE FUNCTION ginint4_queryextract(internal, internal, int2)
467463
RETURNS internal
@@ -474,7 +470,7 @@ AS 'MODULE_PATHNAME'
474470
LANGUAGE C;
475471

476472
CREATE OPERATOR CLASS gin__int_ops
477-
DEFAULT FOR TYPE _int4 USING gin
473+
FOR TYPE _int4 USING gin
478474
AS
479475
OPERATOR 3 &&,
480476
OPERATOR 6 = (anyarray, anyarray) RECHECK,

contrib/intarray/expected/_int.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ SELECT count(*) from test__int WHERE a @@ '(20&23)|(50&68)';
516516
(1 row)
517517

518518
DROP INDEX text_idx;
519-
CREATE INDEX text_idx on test__int using gin ( a );
519+
CREATE INDEX text_idx on test__int using gin ( a gin__int_ops );
520520
SELECT count(*) from test__int WHERE a && '{23,50}';
521521
count
522522
-------

contrib/intarray/sql/_int.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ SELECT count(*) from test__int WHERE a @> '{20,23}' or a @> '{50,68}';
111111
SELECT count(*) from test__int WHERE a @@ '(20&23)|(50&68)';
112112

113113
DROP INDEX text_idx;
114-
CREATE INDEX text_idx on test__int using gin ( a );
114+
CREATE INDEX text_idx on test__int using gin ( a gin__int_ops );
115115

116116
SELECT count(*) from test__int WHERE a && '{23,50}';
117117
SELECT count(*) from test__int WHERE a @@ '23|50';

contrib/intarray/uninstall__int.sql

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,3 @@ DROP FUNCTION boolop(_int4, query_int);
123123
DROP FUNCTION querytree(query_int);
124124

125125
DROP TYPE query_int CASCADE;
126-
127-
--mark built-in gin's _int4_ops as default again
128-
update pg_catalog.pg_opclass set opcdefault = 't'
129-
where opcmethod = (select oid from pg_catalog.pg_am where amname='gin') and
130-
opcname = '_int4_ops';

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy