mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
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.
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
/* $PostgreSQL: pgsql/contrib/intarray/_int.sql.in,v 1.29 2009/03/25 22:19:01 tgl Exp $ */
|
/* $PostgreSQL: pgsql/contrib/intarray/_int.sql.in,v 1.30 2009/04/05 00:40:35 tgl Exp $ */
|
||||||
|
|
||||||
-- Adjust this setting to control where the objects get created.
|
-- Adjust this setting to control where the objects get created.
|
||||||
SET search_path = public;
|
SET search_path = public;
|
||||||
@ -152,23 +152,23 @@ CREATE OPERATOR && (
|
|||||||
-- JOIN = neqjoinsel
|
-- JOIN = neqjoinsel
|
||||||
--);
|
--);
|
||||||
|
|
||||||
CREATE OPERATOR @> (
|
--CREATE OPERATOR @> (
|
||||||
LEFTARG = _int4,
|
-- LEFTARG = _int4,
|
||||||
RIGHTARG = _int4,
|
-- RIGHTARG = _int4,
|
||||||
PROCEDURE = _int_contains,
|
-- PROCEDURE = _int_contains,
|
||||||
COMMUTATOR = '<@',
|
-- COMMUTATOR = '<@',
|
||||||
RESTRICT = contsel,
|
-- RESTRICT = contsel,
|
||||||
JOIN = contjoinsel
|
-- JOIN = contjoinsel
|
||||||
);
|
--);
|
||||||
|
|
||||||
CREATE OPERATOR <@ (
|
--CREATE OPERATOR <@ (
|
||||||
LEFTARG = _int4,
|
-- LEFTARG = _int4,
|
||||||
RIGHTARG = _int4,
|
-- RIGHTARG = _int4,
|
||||||
PROCEDURE = _int_contained,
|
-- PROCEDURE = _int_contained,
|
||||||
COMMUTATOR = '@>',
|
-- COMMUTATOR = '@>',
|
||||||
RESTRICT = contsel,
|
-- RESTRICT = contsel,
|
||||||
JOIN = contjoinsel
|
-- JOIN = contjoinsel
|
||||||
);
|
--);
|
||||||
|
|
||||||
-- obsolete:
|
-- obsolete:
|
||||||
CREATE OPERATOR @ (
|
CREATE OPERATOR @ (
|
||||||
@ -365,8 +365,8 @@ CREATE OPERATOR CLASS gist__int_ops
|
|||||||
DEFAULT FOR TYPE _int4 USING gist AS
|
DEFAULT FOR TYPE _int4 USING gist AS
|
||||||
OPERATOR 3 &&,
|
OPERATOR 3 &&,
|
||||||
OPERATOR 6 = (anyarray, anyarray),
|
OPERATOR 6 = (anyarray, anyarray),
|
||||||
OPERATOR 7 @>,
|
OPERATOR 7 @> (anyarray, anyarray),
|
||||||
OPERATOR 8 <@,
|
OPERATOR 8 <@ (anyarray, anyarray),
|
||||||
OPERATOR 13 @,
|
OPERATOR 13 @,
|
||||||
OPERATOR 14 ~,
|
OPERATOR 14 ~,
|
||||||
OPERATOR 20 @@ (_int4, query_int),
|
OPERATOR 20 @@ (_int4, query_int),
|
||||||
@ -442,8 +442,8 @@ FOR TYPE _int4 USING gist
|
|||||||
AS
|
AS
|
||||||
OPERATOR 3 &&,
|
OPERATOR 3 &&,
|
||||||
OPERATOR 6 = (anyarray, anyarray),
|
OPERATOR 6 = (anyarray, anyarray),
|
||||||
OPERATOR 7 @>,
|
OPERATOR 7 @> (anyarray, anyarray),
|
||||||
OPERATOR 8 <@,
|
OPERATOR 8 <@ (anyarray, anyarray),
|
||||||
OPERATOR 13 @,
|
OPERATOR 13 @,
|
||||||
OPERATOR 14 ~,
|
OPERATOR 14 ~,
|
||||||
OPERATOR 20 @@ (_int4, query_int),
|
OPERATOR 20 @@ (_int4, query_int),
|
||||||
@ -473,8 +473,8 @@ FOR TYPE _int4 USING gin
|
|||||||
AS
|
AS
|
||||||
OPERATOR 3 &&,
|
OPERATOR 3 &&,
|
||||||
OPERATOR 6 = (anyarray, anyarray),
|
OPERATOR 6 = (anyarray, anyarray),
|
||||||
OPERATOR 7 @>,
|
OPERATOR 7 @> (anyarray, anyarray),
|
||||||
OPERATOR 8 <@,
|
OPERATOR 8 <@ (anyarray, anyarray),
|
||||||
OPERATOR 13 @,
|
OPERATOR 13 @,
|
||||||
OPERATOR 14 ~,
|
OPERATOR 14 ~,
|
||||||
OPERATOR 20 @@ (_int4, query_int),
|
OPERATOR 20 @@ (_int4, query_int),
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $PostgreSQL: pgsql/contrib/intarray/uninstall__int.sql,v 1.10 2009/03/25 22:19:01 tgl Exp $ */
|
/* $PostgreSQL: pgsql/contrib/intarray/uninstall__int.sql,v 1.11 2009/04/05 00:40:35 tgl Exp $ */
|
||||||
|
|
||||||
-- Adjust this setting to control where the objects get created.
|
-- Adjust this setting to control where the objects get created.
|
||||||
SET search_path = public;
|
SET search_path = public;
|
||||||
@ -91,10 +91,6 @@ DROP FUNCTION icount(_int4);
|
|||||||
|
|
||||||
DROP FUNCTION intset(int4);
|
DROP FUNCTION intset(int4);
|
||||||
|
|
||||||
DROP OPERATOR <@ (_int4, _int4);
|
|
||||||
|
|
||||||
DROP OPERATOR @> (_int4, _int4);
|
|
||||||
|
|
||||||
DROP OPERATOR ~ (_int4, _int4);
|
DROP OPERATOR ~ (_int4, _int4);
|
||||||
|
|
||||||
DROP OPERATOR @ (_int4, _int4);
|
DROP OPERATOR @ (_int4, _int4);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/intarray.sgml,v 1.6 2009/03/18 20:18:18 tgl Exp $ -->
|
<!-- $PostgreSQL: pgsql/doc/src/sgml/intarray.sgml,v 1.7 2009/04/05 00:40:35 tgl Exp $ -->
|
||||||
|
|
||||||
<sect1 id="intarray">
|
<sect1 id="intarray">
|
||||||
<title>intarray</title>
|
<title>intarray</title>
|
||||||
@ -134,12 +134,12 @@
|
|||||||
<entry>overlap — <literal>true</> if arrays have at least one common element</entry>
|
<entry>overlap — <literal>true</> if arrays have at least one common element</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><literal>int[] @> int[]</literal></entry>
|
<entry><literal>int[] @ int[]</literal></entry>
|
||||||
<entry><type>boolean</type></entry>
|
<entry><type>boolean</type></entry>
|
||||||
<entry>contains — <literal>true</> if left array contains right array</entry>
|
<entry>contains — <literal>true</> if left array contains right array</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><literal>int[] <@ int[]</literal></entry>
|
<entry><literal>int[] ~ int[]</literal></entry>
|
||||||
<entry><type>boolean</type></entry>
|
<entry><type>boolean</type></entry>
|
||||||
<entry>contained — <literal>true</> if left array is contained in right array</entry>
|
<entry>contained — <literal>true</> if left array is contained in right array</entry>
|
||||||
</row>
|
</row>
|
||||||
@ -203,11 +203,13 @@
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
(Before PostgreSQL 8.2, the containment operators @> and <@ were
|
The containment operators <literal>@</> and <literal>~</> are functionally
|
||||||
respectively called @ and ~. These names are still available, but are
|
equivalent to <productname>PostgreSQL</>'s built-in operators
|
||||||
deprecated and will eventually be retired. Notice that the old names
|
<literal>@></> and <literal><@</>, respectively, except that
|
||||||
are reversed from the convention formerly followed by the core geometric
|
<literal>@</> and <literal>~</> work only on integer arrays. These
|
||||||
datatypes!)
|
operator names are deprecated and will eventually be retired. (Notice that
|
||||||
|
these names are reversed from the convention formerly followed by the core
|
||||||
|
geometric datatypes!)
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
@ -228,10 +230,10 @@
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
<filename>intarray</> provides index support for the
|
<filename>intarray</> provides index support for the
|
||||||
<literal>&&</>, <literal>@></>, <literal><@</>,
|
<literal>&&</>, <literal>@</>, <literal>~</>,
|
||||||
and <literal>@@</> operators, as well as regular array equality.
|
and <literal>@@</> operators, as well as regular array equality
|
||||||
The implementation uses an RD-tree data structure with
|
and the built-in <literal>@></> and <literal><@</> operators
|
||||||
built-in lossy compression.
|
(when used on integer arrays).
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
@ -241,11 +243,13 @@
|
|||||||
<literal>gist__intbig_ops</> uses a larger signature and is more
|
<literal>gist__intbig_ops</> uses a larger signature and is more
|
||||||
suitable for indexing large data sets (i.e., columns containing
|
suitable for indexing large data sets (i.e., columns containing
|
||||||
a large number of distinct array values).
|
a large number of distinct array values).
|
||||||
|
The implementation uses an RD-tree data structure with
|
||||||
|
built-in lossy compression.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
There is also a non-default GIN operator class
|
There is also a non-default GIN operator class
|
||||||
<literal>gin__int_ops</>.
|
<literal>gin__int_ops</> supporting the same operators.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
@ -304,7 +308,7 @@ SELECT message.mid FROM message WHERE message.sections @@ '1&2'::query_int;
|
|||||||
<title>Authors</title>
|
<title>Authors</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
All work was done by Teodor Sigaev (<email>teodor@stack.net</email>) and
|
All work was done by Teodor Sigaev (<email>teodor@sigaev.ru</email>) and
|
||||||
Oleg Bartunov (<email>oleg@sai.msu.su</email>). See
|
Oleg Bartunov (<email>oleg@sai.msu.su</email>). See
|
||||||
<ulink url="http://www.sai.msu.su/~megera/postgres/gist"></ulink> for
|
<ulink url="http://www.sai.msu.su/~megera/postgres/gist"></ulink> for
|
||||||
additional information. Andrey Oktyabrski did a great work on adding new
|
additional information. Andrey Oktyabrski did a great work on adding new
|
||||||
|
Reference in New Issue
Block a user