Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2d6cb17

Browse filesBrowse 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
Copy full SHA for 2d6cb17

File tree

Expand file treeCollapse file tree

5 files changed

+6
-14
lines changed
Filter options
Expand file treeCollapse file tree

5 files changed

+6
-14
lines changed

‎contrib/intarray/README.intarray

Copy file name to clipboardExpand all lines: contrib/intarray/README.intarray
+3-2Lines 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

Copy file name to clipboardExpand all lines: contrib/intarray/_int.sql.in
+1-5Lines 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

Copy file name to clipboardExpand all lines: contrib/intarray/expected/_int.out
+1-1Lines 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

Copy file name to clipboardExpand all lines: contrib/intarray/sql/_int.sql
+1-1Lines 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

Copy file name to clipboardExpand all lines: contrib/intarray/uninstall__int.sql
-5Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.