Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 65e758a

Browse files
committed
Remove contrib/intarray's definitions of the <@ and @> operators, so that they
don't cause confusion with the built-in anyarray versions of those operators. Adjust the module's index opclasses to support the built-in operators in place of the private ones. The private implementations are still available under their historical names @ and ~, so no functionality is lost. Some quick testing suggests that they offer no real benefit over the core operators, however. Per a complaint from Rusty Conover.
1 parent eb3a10b commit 65e758a

File tree

3 files changed

+42
-42
lines changed

3 files changed

+42
-42
lines changed

contrib/intarray/_int.sql.in

+23-23
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/contrib/intarray/_int.sql.in,v 1.29 2009/03/25 22:19:01 tgl Exp $ */
1+
/* $PostgreSQL: pgsql/contrib/intarray/_int.sql.in,v 1.30 2009/04/05 00:40:35 tgl Exp $ */
22

33
-- Adjust this setting to control where the objects get created.
44
SET search_path = public;
@@ -152,23 +152,23 @@ CREATE OPERATOR && (
152152
-- JOIN = neqjoinsel
153153
--);
154154

155-
CREATE OPERATOR @> (
156-
LEFTARG = _int4,
157-
RIGHTARG = _int4,
158-
PROCEDURE = _int_contains,
159-
COMMUTATOR = '<@',
160-
RESTRICT = contsel,
161-
JOIN = contjoinsel
162-
);
155+
--CREATE OPERATOR @> (
156+
-- LEFTARG = _int4,
157+
-- RIGHTARG = _int4,
158+
-- PROCEDURE = _int_contains,
159+
-- COMMUTATOR = '<@',
160+
-- RESTRICT = contsel,
161+
-- JOIN = contjoinsel
162+
--);
163163

164-
CREATE OPERATOR <@ (
165-
LEFTARG = _int4,
166-
RIGHTARG = _int4,
167-
PROCEDURE = _int_contained,
168-
COMMUTATOR = '@>',
169-
RESTRICT = contsel,
170-
JOIN = contjoinsel
171-
);
164+
--CREATE OPERATOR <@ (
165+
-- LEFTARG = _int4,
166+
-- RIGHTARG = _int4,
167+
-- PROCEDURE = _int_contained,
168+
-- COMMUTATOR = '@>',
169+
-- RESTRICT = contsel,
170+
-- JOIN = contjoinsel
171+
--);
172172

173173
-- obsolete:
174174
CREATE OPERATOR @ (
@@ -365,8 +365,8 @@ CREATE OPERATOR CLASS gist__int_ops
365365
DEFAULT FOR TYPE _int4 USING gist AS
366366
OPERATOR 3 &&,
367367
OPERATOR 6 = (anyarray, anyarray),
368-
OPERATOR 7 @>,
369-
OPERATOR 8 <@,
368+
OPERATOR 7 @> (anyarray, anyarray),
369+
OPERATOR 8 <@ (anyarray, anyarray),
370370
OPERATOR 13 @,
371371
OPERATOR 14 ~,
372372
OPERATOR 20 @@ (_int4, query_int),
@@ -442,8 +442,8 @@ FOR TYPE _int4 USING gist
442442
AS
443443
OPERATOR 3 &&,
444444
OPERATOR 6 = (anyarray, anyarray),
445-
OPERATOR 7 @>,
446-
OPERATOR 8 <@,
445+
OPERATOR 7 @> (anyarray, anyarray),
446+
OPERATOR 8 <@ (anyarray, anyarray),
447447
OPERATOR 13 @,
448448
OPERATOR 14 ~,
449449
OPERATOR 20 @@ (_int4, query_int),
@@ -473,8 +473,8 @@ FOR TYPE _int4 USING gin
473473
AS
474474
OPERATOR 3 &&,
475475
OPERATOR 6 = (anyarray, anyarray),
476-
OPERATOR 7 @>,
477-
OPERATOR 8 <@,
476+
OPERATOR 7 @> (anyarray, anyarray),
477+
OPERATOR 8 <@ (anyarray, anyarray),
478478
OPERATOR 13 @,
479479
OPERATOR 14 ~,
480480
OPERATOR 20 @@ (_int4, query_int),

contrib/intarray/uninstall__int.sql

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/contrib/intarray/uninstall__int.sql,v 1.10 2009/03/25 22:19:01 tgl Exp $ */
1+
/* $PostgreSQL: pgsql/contrib/intarray/uninstall__int.sql,v 1.11 2009/04/05 00:40:35 tgl Exp $ */
22

33
-- Adjust this setting to control where the objects get created.
44
SET search_path = public;
@@ -91,10 +91,6 @@ DROP FUNCTION icount(_int4);
9191

9292
DROP FUNCTION intset(int4);
9393

94-
DROP OPERATOR <@ (_int4, _int4);
95-
96-
DROP OPERATOR @> (_int4, _int4);
97-
9894
DROP OPERATOR ~ (_int4, _int4);
9995

10096
DROP OPERATOR @ (_int4, _int4);

doc/src/sgml/intarray.sgml

+18-14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/intarray.sgml,v 1.6 2009/03/18 20:18:18 tgl Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/intarray.sgml,v 1.7 2009/04/05 00:40:35 tgl Exp $ -->
22

33
<sect1 id="intarray">
44
<title>intarray</title>
@@ -134,12 +134,12 @@
134134
<entry>overlap &mdash; <literal>true</> if arrays have at least one common element</entry>
135135
</row>
136136
<row>
137-
<entry><literal>int[] @&gt; int[]</literal></entry>
137+
<entry><literal>int[] @ int[]</literal></entry>
138138
<entry><type>boolean</type></entry>
139139
<entry>contains &mdash; <literal>true</> if left array contains right array</entry>
140140
</row>
141141
<row>
142-
<entry><literal>int[] &lt;@ int[]</literal></entry>
142+
<entry><literal>int[] ~ int[]</literal></entry>
143143
<entry><type>boolean</type></entry>
144144
<entry>contained &mdash; <literal>true</> if left array is contained in right array</entry>
145145
</row>
@@ -203,11 +203,13 @@
203203
</table>
204204

205205
<para>
206-
(Before PostgreSQL 8.2, the containment operators @&gt; and &lt;@ were
207-
respectively called @ and ~. These names are still available, but are
208-
deprecated and will eventually be retired. Notice that the old names
209-
are reversed from the convention formerly followed by the core geometric
210-
datatypes!)
206+
The containment operators <literal>@</> and <literal>~</> are functionally
207+
equivalent to <productname>PostgreSQL</>'s built-in operators
208+
<literal>@&gt;</> and <literal>&lt;@</>, respectively, except that
209+
<literal>@</> and <literal>~</> work only on integer arrays. These
210+
operator names are deprecated and will eventually be retired. (Notice that
211+
these names are reversed from the convention formerly followed by the core
212+
geometric datatypes!)
211213
</para>
212214

213215
<para>
@@ -228,10 +230,10 @@
228230

229231
<para>
230232
<filename>intarray</> provides index support for the
231-
<literal>&amp;&amp;</>, <literal>@&gt;</>, <literal>&lt;@</>,
232-
and <literal>@@</> operators, as well as regular array equality.
233-
The implementation uses an RD-tree data structure with
234-
built-in lossy compression.
233+
<literal>&amp;&amp;</>, <literal>@</>, <literal>~</>,
234+
and <literal>@@</> operators, as well as regular array equality
235+
and the built-in <literal>@&gt;</> and <literal>&lt;@</> operators
236+
(when used on integer arrays).
235237
</para>
236238

237239
<para>
@@ -241,11 +243,13 @@
241243
<literal>gist__intbig_ops</> uses a larger signature and is more
242244
suitable for indexing large data sets (i.e., columns containing
243245
a large number of distinct array values).
246+
The implementation uses an RD-tree data structure with
247+
built-in lossy compression.
244248
</para>
245249

246250
<para>
247251
There is also a non-default GIN operator class
248-
<literal>gin__int_ops</>.
252+
<literal>gin__int_ops</> supporting the same operators.
249253
</para>
250254

251255
<para>
@@ -304,7 +308,7 @@ SELECT message.mid FROM message WHERE message.sections @@ '1&amp;2'::query_int;
304308
<title>Authors</title>
305309

306310
<para>
307-
All work was done by Teodor Sigaev (<email>teodor@stack.net</email>) and
311+
All work was done by Teodor Sigaev (<email>teodor@sigaev.ru</email>) and
308312
Oleg Bartunov (<email>oleg@sai.msu.su</email>). See
309313
<ulink url="http://www.sai.msu.su/~megera/postgres/gist"></ulink> for
310314
additional information. Andrey Oktyabrski did a great work on adding new

0 commit comments

Comments
 (0)